Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-04-2010, 12:12 AM
|
#1
|
|
LQ Newbie
Registered: Jan 2009
Posts: 15
Rep:
|
Passing SSH a password through command line
Hello,
I am writing a script to get hardware information of a particular UNIX machine. To do this, I ftp a shell script (commands to get h/w information) to the target machine and then use SSH to remote the remote script.
With FTP, I can pass a password accepted as input the shell script. How can I pass the same password to SSH ? This is because I do not want the user to enter the password twice.
I am not worried about the password security.
Thanks
|
|
|
|
08-04-2010, 12:28 AM
|
#2
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,796
|
Hello,
Have a look at this thread.
Kind regards,
Eric
|
|
|
|
08-04-2010, 12:29 AM
|
#3
|
|
Member
Registered: May 2006
Location: Brisbane, Australia
Posts: 117
Rep:
|
ssh has methods to allow you to log into a machine from a specific account without a password.
See http://www.cit.griffith.edu.au/~anth.../ssh_howto.txt
Their are also wrapper programs (like expect) that will wrap the command in a fake TTY so that you can again pipe a password into the command, while the command thinks it is getting it from a users TTY.
See...
http://www.cit.griffith.edu.au/~anth...eractive.hints
Where I wrote down tips and solutions to controlling interactive programs.
|
|
|
|
08-05-2010, 12:02 AM
|
#5
|
|
LQ Newbie
Registered: Jan 2009
Posts: 15
Original Poster
Rep:
|
Hi All,
Thanks for the replies. I can aware of ssh-keygen but I do not want to use that since there are several 100 machines I want to connect to and dont want to do this for all machines.
I tried expect but I get an error command not found
Thanks
|
|
|
|
08-05-2010, 12:17 AM
|
#6
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,796
|
Quote:
Originally Posted by info1686
Hi All,
Thanks for the replies. I can aware of ssh-keygen but I do not want to use that since there are several 100 machines I want to connect to and dont want to do this for all machines.
I tried expect but I get an error command not found
Thanks
|
Hi,
Have you read the thread I linked to in post #2? Have a look at sshpass.
Kind regards,
Eric
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:45 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|