There are just three simple steps needed to automate your SSH/SFTP logins to remote Unix/Unix-like servers from your Ubuntu/Linux distribution, or an emulator on Windows like Cygwin.
1) Run ssh-keygen
abdullah@desktop:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/abdullah/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/abdullah/.ssh/id_rsa. Your public key has been saved in /home/abdullah/.ssh/id_rsa.pub. The key fingerprint is: 06:23:fc:34:0f:12:40:b2:5e:7c:41:eb:4f:a2:ab:24 abdullah@desktop The key's randomart image is:
2) Run ssh-copy-id <username>@<server-name>
abdullah@desktop:~$ ssh-copy-id email@example.com firstname.lastname@example.org's password: Now try logging into the machine, with "ssh 'email@example.com'", and check in: ~/.ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
3) Login to your server using ssh
abdullah@desktop:~$ ssh 'firstname.lastname@example.org' Welcome to MyServer.com! Last login: Sun Sep 25 23:22:21 2011 from 18.104.22.168 email@example.com:~#
If you want a quick shortcut in the GUI, you could add a Custom Application Launcher to the panel with the ssh login command, as shown below:
Clicking the panel icon will directly open the terminal at the server with you logged in.
Note that this will also automate the login for SFTP, so you won’t need to type in your passwords there anymore too!