SSH Logins Without Passwords

FAIL (the browser should render some flash content, not this).

Download in .ogv format


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

sshd Port

mikegerwitz's picture

I ran into problems when attempting to use ssh-copy-id because my ssh server is running on a port other than 22 (the default). Ideally, one would imagine the following command to work:

ssh-copy-id -p XXXX -i ~/.ssh/ username@host

However, that didn't do anything but output an error. The solution was to enclose it in quotes as follows:

ssh-copy-id '-p XXXX -i ~/.ssh/ username@host'

Hope that helps.

Mike Gerwitz
Free Software Developer

Where's the penguin?

Anonymous's picture

Hey the tips, love the Tux namesake (your pup)...but when are you going to get a penguin? And I'm not speaking of the stuffed penguins you have all over your office... ;)

Olfactory Failure

Shawn Powers's picture

I suspect when every member of my family loses the ability to smell, I might be able to get a penguin. But even then, they'd probably object to the year round air conditioning and indoor icy pool.

I worry I might end up stuffed. :)

Shawn Powers is a Linux Journal Associate Editor. You might find him on IRC, Twitter, or training IT pros at CBT Nuggets.

security security!

mookie's picture

While this is a useful tip, it's a bit of a security risk. Actually, it's a huge security risk. If the machine with the private key is ever compromised (like Brett said), you'll put all machines that have your public key at risk.

A better way of doing this is to put a password on the sshkey itself. Then use ssh-agent to create a secure socket for ssh'ing with only one use of a password. Much more secure and only slightly less convenient (since you have to type your password once).

Security Concerns

Brett Dreher's picture

Great simple video as this definitely does have some worthwhile use in the real world.

My concern is the general security of using only a key-authentication setup, if only one machine is compromised on the network then suddenly it's an open playground for any would-be misfit where as if each machine requires the key authentication (to verify the correct machine) as well as password (to verify the actual identity) then you stand more of a chance of isolating any security issues.

I've always liked the idea of password-less ssh especially for the automation of certain tasks (rsync for example, works wonders with it) but the security implementation has always alarmed me a bit.