LinuxQuestions.org
Visit Jeremy's Blog.
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-25-2010, 12:29 AM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Rep: Reputation: 69
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-25-2010 at 12:30 AM.
 
Old 07-25-2010, 12:45 AM   #2
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

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

Last edited by trist007; 07-25-2010 at 12:47 AM.
 
Old 07-25-2010, 03:23 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 09:26 AM   #4
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Original Poster
Rep: Reputation: 69
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 04:50 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration