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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
celticianAuthor Commented:
oh ok thanks, that solution will fit my needs!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSH / Telnet Software

From novice to tech pro — start learning today.