LinuxQuestions.org
Register a domain and help support LQ
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 12-02-2010, 10:49 PM   #1
ovaisalam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
Question user defined input in shell script


i want ssh a remote server through shell script with predefines username and passwd

i dont know how to use expect command to do that

please help me
 
Old 12-03-2010, 12:57 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,492

Rep: Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892Reputation: 1892
Why do you need expect? Can you not just use read and then on execution enter your password?
 
Old 12-03-2010, 11:14 PM   #3
ovaisalam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
I just want to give some user defined input

because daily i access many server and sometimes i use same commands

so that i want to use it.
 
Old 12-05-2010, 07:03 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
You could use Expect, but it's very risky (security) to put usernames+passwds in a script.
How about ssh auth-keys or ssh-agent?
 
Old 12-08-2010, 06:44 AM   #5
ovaisalam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
yes, i agree to ssh rsa auth and i use this for my regular server,

i just want to use it for my other uses.

well thanks
 
  


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
using an shell script how to change a value in a file according to the user input badrinath_tcs Linux - Software 6 09-28-2009 07:29 PM
A way to open a window for user input in shell script? Anithen Linux - Software 10 08-24-2008 01:51 PM
SHell Script Help! When reading input from a user sfmadmax Linux - Newbie 3 12-12-2007 12:03 AM
user defined shell commands ashley_31 Linux - Software 11 05-15-2006 03:27 AM
Shell script user input tuckermaddox Linux - Newbie 5 08-12-2004 03:14 AM


All times are GMT -5. The time now is 05:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration