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
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:
The key's randomart image is:
2) Run ssh-copy-id <username>@<server-name>
abdullah@desktop:~$ ssh-copy-id email@example.com
Now try logging into the machine, with "ssh 'firstname.lastname@example.org'", and check in:
to make sure we haven't added extra keys that you weren't expecting.
3) Login to your server using ssh
abdullah@desktop:~$ ssh 'email@example.com'
Welcome to MyServer.com!
Last login: Sun Sep 25 23:22:21 2011 from 18.104.22.168
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!