Alternative to SSH key from script

I cant use SSH keys for my directory logon as the root folder permissions are 777, and it keeps asking for login again even if the ssh keys are set.

We need the ssh keys for an auto-logon from a script and stop asking for a password everytime the script is launched, so what alternative can we use to override this issue?

is ther any way to send the passwor from the script when requested??
LVL 1
celticianAsked:
Who is Participating?
 
savoneCommented:
Oh understood.  Well, you can use an expect script to automatically login.

I don't think I am allowed to post links here, but if you do a google search for "expect script to login to linux server" you will find your answer in the first couple of search results.

Good luck.
0
 
savoneCommented:
Root folder shouldn't be 777, thats a huge security risk. Also that should have no effect on authentication. There is most likely another issue. I would try making the keys again (without a passphrase).

Also, remote root login in a big security risk in itself.
0
 
TintinCommented:
Go back a few steps.

The root directory should NEVER have 777 permissions.   That's asking for trouble.

ssh will reject key authentication if the permissions on the .ssh directory are too open.   Correct your directory/file permissions so you can correctly use key authentication.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
savoneCommented:
@Tintin is correct about the permissions for the .ssh directory.  The directory itself should be 700 and the authorized_keys file should be 600 if I remember correctly.
0
 
celticianAuthor Commented:
I know, but i can't change those settings, thats another company's department out of my reach....

I must adapt to these conditions.
0
 
celticianAuthor Commented:
oh ok thanks, that solution will fit my needs!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.