Home > ssh, Tip > Requirements for a successful password-less ssh setup

Requirements for a successful password-less ssh setup

OK this password-less ssh issue has bothered me for quite a long time and I am officially making the requirements a post so I (and hopefully you) can benefit from it.

The list is quite simple:
1) chmod go-w ~/
2) chmod 700 ~/.ssh
3) chmod 600 ~/.ssh/authorized_keys

for ssh version 2 you might need to add “2” to the end of authorized_keys, that is, step 3) would become
chmod 600 ~/.ssh/authorized_keys2

Item 1) is easy to overlook, what the command does is to remove write permission for group (g) and others (o) from the home directory.

A good place to trouble-shoot the key-based login problem is /var/log/secure, if you see something like the following

Authentication refused: bad ownership or modes for directory /path/to/the/user_ssh_folder

You know you need to check and fix the ownership of directories/file mentioned in the list.

Advertisements
Categories: ssh, Tip
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: