Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-21-2008, 11:03 PM   #1
LQ Newbie
Registered: Nov 2008
Location: India
Posts: 9

Rep: Reputation: 0
How to use expect command?

hai all,

When ever I connect with server i am entering the password manually. Is there any way to login with out entering the password.
Old 11-21-2008, 11:30 PM   #2
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
There are many methods including rhosts and ssh key exchange (probably your best bet) .. but since you suggested expect in your subject - here is an expect example for login automation. There are many expect tutorials available if you search for them
#!/usr/bin/expect -f 
spawn telnet yourhostname
expect "login" 
send "jprathap\r" 
expect "Password:" 
send "123jprathap123\r" 


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
Expect script, scp and find command unihiekka Programming 1 10-17-2008 04:11 PM
How to use EXPECT command to scp or ssh? thefountainhead100 Linux - Software 6 03-28-2008 07:41 PM
LXer: Command line automation with Expect-lite LXer Syndicated Linux News 0 03-10-2008 06:20 PM
exec the expect command in a shell script wanghao Linux - Networking 6 11-24-2007 12:06 AM
using Expect command to automate prgms mehargags Linux - General 9 06-15-2003 08:16 PM > Forums > Linux Forums > Linux - Newbie

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

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