I need to create a shell script which will login to a unix system with user root. I also need to supply the password for root through script only instead of entering it manually.
After i am logged in to the system i need to excute all the necessary commands.
so far i have done this..but it asks for password to be entered.
ssh -l root HOSTNAME/IP
echo "WELCOME to ROOT"
exit
Expect is a module through which you automate the interactions.
It will spawn and execute the script.
This is just creating object for expect module, in which you have to give list of regular expression in which format it interacts with you to get the input..
Then it spawns and executes command given (ssh command ), and it matches each interaction message with the given regular expression, and sets the variable exp_match_number with corresponding value.
so if exp_match_number has the value 1, then interaction message matches with the
''want to continue connecting'' then you can give your input by writing into the expect object like
print $command "yes\r".
ssh shell means secure shell. A password in a plain text script isn't, really. A more secure route is generating keys and using an authorized_keys file containing public keys of trusted users on every system (man ssh).
Guys please help me I have a linux class and I want to write a shell script who shows which user loged in and show the process that are active in his/her shell in another text file and email that file to root just when the user loged out
Thanks every bod (1 Reply)
Hello all,
for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell.
So serverA launches the ssh command to serverB which has a local user with my script as a login shell.
Local script works like a charm on his own.
serverB$ grep... (20 Replies)
hi,
i want to login as a different user inside a shell script and then call another shell script from that script.
how to do that?
original script : script_A.sh
so when the script_A.sh is called , i want to login as a different user and then call another shell script(script_B.sh) from... (3 Replies)
Hi Gurus,
I need help in writing a script which should say which user has used or logged in in the server from past one month using FTP or TELNET and the output should be of the form
Username Service NumberofTimes Date.
Thanks in Advance.
---------- Post updated at 04:01 PM... (1 Reply)
Hi,
Can anyone pls help me to automate login to cvs. I basically want to login to cvs and update a file.
the script always gets to the login and returns the prompt for a password.
Is there any way to send the password in the script itself.
Here is the script:
#!/bin/ksh... (0 Replies)
Hi,
I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Hi All,
This is my first post. Need your favour guys.
I need to authenticate syabse login/password thru shell script.
I am getting the ID & Pwd form user and storing it in variable..
But how to authenticate and echo user back if the id/pwd doesnt work.
isql -U$1 -P$2 -S$3 ??
thanks in... (3 Replies)
Any help on this ..... its a bit urgent !!!!
Hi
Can anybody provide info about the following???
i want to issue su (switch user) command from within a shell script
how to take the password without user intervention from the shell script only???? i.e using apssword which is already... (2 Replies)
Hello all,
I would like to login from one unix-system with a (tcsh)-script to an other unix-system.The login-procedure and the transmission of username, resp. password runs via ssh.
The problem is after logging onto the remote server once "Enter" has to be pressed, before one gets to the... (1 Reply)
is it possible for me to have a shell script log me in to a telnet session? i have in mind something along the lines of
% telnet host < script, where the first two lines of script will be username and pass followed by a list of commands to execute on the remote host.
this doesn t work as... (4 Replies)