LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2006, 09:16 PM   #16
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62

Ok understand now, unfortunately I don't know of anyway to autofeed a password.
 
Old 04-08-2006, 05:47 AM   #17
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
I think expect will do what you want.
 
Old 04-21-2006, 07:17 PM   #18
GNUsavior
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 0
ok, i cheated slightly...but i have another question in doing so...towards the beginning of my script i decided to use the 'ssh-agent /bin/bash' command. This initially worked fine...my script would ask a few questions and then this would run along with the 'ssh-add' command it would ask me for my password once, leaving my key in cache and continuing. Now all of a sudden its constantly telling me it cant connect to my authentication manager. From what i understand this is because certain environemtn variables are not set, such as SSH_AUTH_SOCK. Here is the portion on how i had it:

Code:
# use ssh-agent to set up proper environment variables
echo ssh-agent /bin/bash
# add the current users key to cache and ask for password
ssh-add
I suspect when this working smoothly that maybe i had put in the command manually and it was still lingering. So apparantly this is wrong, what is right? The ssh-agent starts a sub-shell where the environment strings are stored there and not in the parent as i understand it. If i just go `ssh-agent /bin/bash` and such, nothing shows on the screen until i type 'exit'. How do i put this in my script and get the output and behavior i'm looking for? Thanks for the input.
 
Old 04-24-2006, 10:31 AM   #19
GNUsavior
LQ Newbie
 
Registered: Dec 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Any ideas anyone?
 
Old 04-24-2006, 09:30 PM   #20
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You need to get keychain in order to manage ssh-manager and make sure that every ssh process can pick up the proper ssh-manager session.
http://www.gentoo.org/proj/en/keychain/

Please note that keychain may want to put your session credentials in a subdirectory, then look for them in the main directory. I handled this with a symlink.

I am doing the exact same thing you are doing, remotely managing/reconfiguring linux machines via a scriptfrom a server. I question that you can't have scripts on your client machine and run them; seems to me that if you have SSH access you certainly can put a script on the client, run it, then delete it. This is what I do.

By doing it that way, I eliminate the problem you are having, of multiple password entries. I upload the script, run it sudo exactly once via SSH, and it gathers all data/does all work. I enter the password once. When I am all done, I delete the script.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell scripts rocketgo Linux - General 10 12-01-2003 05:20 AM
ssh using shell scripts Alek Linux - Networking 4 09-05-2003 01:28 PM
SSH using shell scripts Alek Linux - General 2 08-28-2003 02:52 PM
shell scripts... roofy Linux - Newbie 13 05-06-2003 06:06 PM
Shell scripts anon227 Linux - Software 1 01-03-2003 03:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration