Making server connections with one password

When you have to connect to a new server you can save a ton of time by uploading your public key so you do not have to remember and type the password again and again for every server. (you are using different passwords for all your slices and VPSes?)

If you do not have a public key then, on Mac or Linux, just open up a terminal and type

cd

Then type
ssh-keygen -t rsa

It will ask for a password. This ONE password you can use on all these servers but it is related to your key not the server so make one up and write it down somewhere safe (maybe a post it under your keyboard? just kidding)

Once you are done you now have a new folder and file.
Type this

cd .ssh

then type
ls

you should see id_rsa.pub
Now take a moment to scp (secure copy) that to the new slice, server, VPS, cloud hosted solution or whatever trendy name it has. Type
scp id_rsa.pub loginname@newslice.com:~/

Then go log in using the password for that server and we are almost done.
ssh loginname@newslice.com

You should now be logged in and in the same folder you sent that magic file to.
Now type
cat id_rsa.pub >> .ssh/authorized_keys

This will append that file or add it if it is not there.
Type
rm id_rsa.pub

to clean up. Then type
exit

Back at your local terminal try to ssh again and now the only password you need is the one you set for your public key.

Faceted Search

Tags

Author Profile

Alfred Nutile's picture
Alfred Nutile

Not counting my Commodore 64 years, I began my IT career when Windows 95 hit the scene and Google was just a glimmer on the Californian horizon. I discovered Drupal four years ago when it was giving Joomla a run for its money.
 
At the time, I was working as the IT manager at the National Priorities Project (NPP). We were using Joolma and getting about 200,000 visitors a month and the site was not scaling well.  I saw the limits of Joomla and the promise of Drupal 4 with its taxonomy system, clean urls, and security features.  I converted NPP to Drupal and migrated their main database,  http://nationalpriorities.org/nppdatabase_tool, from webobjects to a Drupal-friendly structure in MySQL.  Still not satisfied, I moved NPP’s constituent data (including their 25,000 member email list) out of the expensive Raiser's Edge and into the free and open source CiviCRM 1.8, saving the company money that it was spending on their desktop software.
 
Thus began my commitment to supporting non-profits by creating affordable, custom-built content management systems in Drupal and CiviCRM. I founded River Valley Tech Collective as a collaborative team of other like-minded techies to provide Drupal-driven sites to a wider range of non-profits, educational institutions and local community organizations.