LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2010, 11:29 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
Trying to think of a way to ssh without interactivity and not using the publickey...


Maybe something like this. I execute ssh host and then wait 1 second and then echo the password into stdin. Just experimenting. Would there be a way to get this right?
Code:
`ssh host` < sleep 1; echo 'password\n' 1>&0

Last edited by trist007; 07-24-2010 at 11:30 PM.
 
Old 07-24-2010, 11:45 PM   #2
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Original Poster
Rep: Reputation: 70
Or will this not work because that ssh prompt that asks for password has already entered encrypted mode?

Last edited by trist007; 07-24-2010 at 11:47 PM.
 
Old 07-25-2010, 02:23 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
I'm curious as to why you want to do this, but the Expect tool is what you want. It's designed to enable you to automate 'manual' interactions like passwd prompts. The security is of course a worry as you'd have the passwd 'en clair'.
Another option for long running sessions is ssh-agent; basically you login to ssh-agent first, supplying your passed; it then memorizes it and and supplies it to any subsequent ssh cmd run from within that session.
 
Old 07-30-2010, 08:26 AM   #4
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Original Poster
Rep: Reputation: 70
Excellent, I just wanted to become more proficient at bash scripting. Yes passwords in the clear is not good, I will use it with caution. Thanks again chrism01.
 
  


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
[SOLVED] ssh killing me :( Permission denied (publickey) grail Linux - Newbie 10 07-06-2010 10:47 AM
[SOLVED] SSH - Permission denied (publickey,keyboard-interactive) sarves Linux - Newbie 3 05-12-2010 12:55 AM
ssh client say me Permission denied.(publickey). linderox Linux - Networking 2 02-27-2008 09:36 AM
ssh publickey authentication spx2 Linux - Security 11 01-11-2008 05:27 AM
Trouble configuring SSH publickey pioniere Linux - Security 4 02-25-2005 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:28 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