Wednesday, April 28, 2010

peculiar ssh requirement on AIX

Some days back I had a requirement to invoke scripts from a remote server periodically.
This is a classic requirement where one of the following solutions can be used :
1. rsh (where remote server would have added my user:host to the list of authenticated machines) and my machine can execute any command on the remote-machine bypassing login.
2. expect script using which I could have automated the login into the remote-machine and run the scripts.
3. ssh login without password.

Method 1 and 2 are not secure and 2nd method has the added disadvantage of changing the password in the script every time the login password changes.

So, I decided to use "ssh login". There are some good links over the Internet which provides the steps :
http://linuxproblem.org/art_9.html
http://www.linuxjournal.com/content/save-authentication (this is something which I contributed some time back)

All the steps are fine on AIX; but an added requirement.
The following files/directories should have these permissions for the automatic login to work fine :
chmod go-w ~/;
chmod 700 ~/.ssh;
chmod 600 ~/.ssh/authorized_keys

Hope this saves others the anxious moments I had to go through.

No comments:

Post a Comment