Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 15th, 2011, 8:08 AM   #1
Mycoinss
Newbie
 
Join Date: Jan 2011
Posts: 16
Rep Power: 0 Mycoinss is on a distinguished road
input password by shell script

Dear

After having problem with telnet, using shell script. now i having problem how to input a password using shell script.

after my program run..

--- Telnet x.x.x.x
automatically show : login name
after that : password login :

so how do i input a login name, automatically in shell script.

i already tried like this
telnet x.x.x.x
sleep 60
send "W"
sleep 5
send "A"

or
telnet x.x.x.x
sleep 60
echo "w"
sleep 5
echo "a"

need any advice
Mycoinss is offline   Reply With Quote
Old Mar 15th, 2011, 7:01 PM   #2
scottn
Hobbyist Programmer
 
scottn's Avatar
 
Join Date: Sep 2010
Location: der Schweiz
Posts: 146
Rep Power: 5 scottn is on a distinguished road
Re: input password by shell script

Hi.

My advice is: Don't use telnet!

If you have to, then don't expect it to read credentials from standard input.

Use a tool like expect to feed it the credentials.

Skipping other, and equally insecure methods, the best - actually, de facto - method would be to use ssh.
__________________
Solaris - AIX - OS X
UNIX not GNU
SPAM Hater
scottn is offline   Reply With Quote
Old Mar 16th, 2011, 12:18 AM   #3
Mycoinss
Newbie
 
Join Date: Jan 2011
Posts: 16
Rep Power: 0 Mycoinss is on a distinguished road
Re: input password by shell script

Hi..

i already tried expect, but the output is no such a command. I'm using RHEL 5.5.

but i'm interest trying ssh.. do you have a simple command.
Mycoinss is offline   Reply With Quote
Old Mar 16th, 2011, 1:52 AM   #4
Patsie
Professional Programmer
 
Patsie's Avatar
 
Join Date: Jun 2010
Posts: 450
Rep Power: 5 Patsie is on a distinguished road
Re: input password by shell script

There's an example right here in your other thread about this same subject...
Patsie is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script help ben2 Bash / Shell Scripting 1 Jun 12th, 2010 6:19 PM
A shell script that makes backup copies of changed files (also involving CRON) riahc3 Bash / Shell Scripting 2 Dec 29th, 2009 6:17 PM
rbs script dialog box user input principle question Datalanding Other Scripting Languages 1 Dec 18th, 2008 1:44 AM
My First Shell Script Teecha Bash / Shell Scripting 5 Nov 25th, 2005 12:52 AM
using getopt in a shell script pico Bash / Shell Scripting 0 Jan 13th, 2005 9:57 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:17 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC