« Filesystem Sharing Between OSX and Ubuntu | Main | Look Out, Boyd Tinsley »

ssh/scp Login Without Password

I'd been wanting to figure this out for awhile, and yesterday finally took a few minutes to dig up the answer, which I found most clearly stated here by Mathias Kettner.

If you want to be able to login to multiple machines, you still only have to do the first step once. After you've created the public and private key files once, you can copy the same public key to each server using the steps that follow.

NOTE: I've slightly modified these directions from Mathias' copy to be more pertinent to the specific case of a local copy of Mac OSX connecting to remote servers, but the resulting commands are identical.

First open a terminal session on your Mac and generate a pair of authentication keys. Do not enter a passphrase:

your-computer:~> ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A


Now use ssh to create a directory ~/.ssh as user myusername on myserver.com. (The directory may already exist, which is fine):

your-computer:~> ssh myusername@myserver.com mkdir -p .ssh

myusername@myserver.com's password:


Finally append your new public key to myusername@myserver.com:.ssh/authorized_keys and enter myusername's password one last time:

your-computer:~> cat .ssh/id_rsa.pub | ssh myusername@myservername.com 'cat >> .ssh/authorized_keys'

myusername@myservername.com's password:


From now on you can log into myservername.com as myusername from your terminal without a password:

your-computer:~> ssh myusername@myservername.com

myservername:~>


Links


  3d 9pm abacusproject administration advertising ajax altera amazon apache apartments apartments2011 api apple apps art audio aws backup blog books browser business california camera centralcoast certification chaos cnc coffee computer cooking css culture data database debian dedicatedserver design development dexpogroupa documentation earth economics electronics email engineering environment events filetype:pdf firefox firefox:toolbar flash fonts food fpga free funny games gis git google gps graphics guitar gumspots hacking hacks hardware history hometheater hosting html humor ie images imported indian indoorpositioning innovation interface internet investing iphone ipod ireland itp java javascript jobs jsp kharagpur latex led library light linux lodging mac macbook mail maininfoitp manufacturing map mapping maps marketing mccain media:document mikrokopter mobile mozilla music mysql nas network news northcoast nyc obama opengl opensource orb osx park parts pcb pcbfabrication pdf performance photography physics pic plugin poker politics postfix printing privacy processing programming projects prototyping ps3 psychology radio rails realestate recipes redwoods reference regex rest rfid rss ruby rubyonrails scholarships science search security server servlet sfsublet siliconeswitches social socialsoftware society software spi starthere startup statistics stepper storage subversion svn swivel sysadmin tcamp technology tedpresentation theory thesis tools travel tv ubuntu usb usbdongle video visualization web web2.0 webdesign webdev webdevelopment weddingvenue westcoast2011 wff where2.0 wifi windows wireless wordpress yosemite zigbee

Design Directory

Music

Where am I?

Recent Photos

Powered by
Movable Type 3.35