ssh
In this example
Destination is puna-o-te-ki dialed up on a 3G Vodafone mobile broadband modem. It gets a DHCP address AND is blocking ssh inbound.
Our Middle server is an always on server behind a NATd network also on a DHCP WAN address. That WAN address is advertised via DynDNS so we know where to look for [...]
If you’re forever typing in long ssh commands to get into your servers – here’s a handy shortcut.
$ ssh laudanum@wainui.houseoflaudanum.com -p2222
Translates to
$ ssh wainui
Using this config file.
$ less ~/.ssh/config
Host wainui
HostName wainui.houseoflaudanum.com
User laudanum
Port 2222
IdentityFile ~/.ssh/id_rsa
(mt) Set up authorized keys (to enable automatic login)
Copy your public key from the machine you want to backup to.
sh-3.2$ cat ~/.ssh/id_rsa.pub
Enable SSH and then SSH into (mt).
-bash-3.2$ cd
-bash-3.2$ whoami
[username]
-bash-3.2$ su
Password:
[root@domain domain.com]# mkdir .ssh
[root@domain domain.com]# chown [username] .ssh/
[root@domain domain.com]# exit
-bash-3.2$ vi .ssh/authorized_keys2
[paste in copied keys making sure you remove pasted in linebreaks]
-bash-3.2$ chmod 600 .ssh/authorized_keys2
Test [...]
One useful application of screen – ssh in to a computer, run a command that will take a while, disconnect and go home, ssh back in and reconnect to the command you were running.
whale:mediaplayer rossetti$ ssh knoppix@10.0.0.109
knoppix@Knoppix:~$ screen rsync -avvz –numeric-ids /media/hda1/ /media/transit/mini-dell/media/hda1/
[CTRL+A CTRL+D disconnect]
[detached]
knoppix@Knoppix:~$ screen -ls
There is a screen on:
4489.pts-1.Knoppix (Detached)
1 Socket in /var/run/screen/S-knoppix.
knoppix@Knoppix:~$ exit
whale:mediaplayer [...]