zondag 6 maart 2011

sFTP and some usefull commands regarding navigation

sFTP stands for secure file transfer protocol. If you are using openSSH you already have sFTP and you can use it in the same port as you are using SSH.

the command:$ ls is handy to determine what is in your current directory. To make it human readable however you might want to use $ ls -h. Lets add a little more detail $ ls -lh and to spice it up even a little more we would like to see our 'hidden' files $ ls -lha. Hidden files are file names that start with '.' (example '.bash_history').

And as we remember from the first lesson, directories are files to[1]. You can also hide directories with this.

something else I used a lot before but I just now fully realised how it actually worked it cat. cat is used to print a text to the prompt this is very useful if you'd like to see some info file like $ cat /proc/cpuinfo

[1]Directories are basically lists of files subdirectories and their location on the hard drive.

zaterdag 5 maart 2011

Working with Byobu

Byobu lets you have multiple virtual terminals which you can switch between. It also gives you some information about your pc like the current load, updates waiting to be installed, ram ect.
Byobu from Putty requires to have Terminal >Change sequence send by: >function keys: Set To VT100+. This will enable you to use F1, F2, F3 and F4. F5 to F6 won't work.
F2 to Create a new window
F3 got to prev window
F4 go to next window
'screen -r' reattach
<ctrl-A> then K → to kill a window

F5 Reload profile
F6 Detach from session
F7 Scrollbakc and search
F8 Rename a window
F9 Configuration
F12 Lock this terminal

Installing openSSH

Install openssh-server
sudo aptitude openssh-server
Okay installation was easy, now the configuration.
nano /etc/ssh/sshd_config
But before we do that we might want to take a backup of that.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
After editing the /etc/ssh/sshd_config file you'll have to restart the server to let the changes have an effect. sudo /etc/init.d/ssh restart

Our ISP blocks port 22 so we'll set that to port 5022 in the /etc/ssh/sshd_config. We forward router port 5022 TCP and setup a free dns from dyndns.org. We use the
sudo /etc/init.d/ssh restart
and there we go. SSH is set-up.