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 an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

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.

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix