login from a shell script?????


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting login from a shell script?????
# 1  
Old 07-16-2007
login from a shell script?????

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 stored ina variable within the shell script????


#!/usr/bin/sh

PASSWORD="hello"

su USER
// Here the password should be read from $PASSWORD variable.

Please tell me how it is possible??????



Thanks

Last edited by skyineyes; 07-16-2007 at 05:20 AM..
# 2  
Old 07-16-2007
Please provide any comments on the following. its highly urgent for me ......
# 3  
Old 07-16-2007
I want to know also
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script for login user and email

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)
Discussion started by: hamedk1122
1 Replies

2. Shell Programming and Scripting

Script as login shell (passing args to login shell)

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)
Discussion started by: maverick72
20 Replies

3. Shell Programming and Scripting

How to login as a different user inside a shell script?

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)
Discussion started by: Little
3 Replies

4. Shell Programming and Scripting

Shell script for user login information.

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)
Discussion started by: rama krishna
1 Replies

5. Shell Programming and Scripting

Automate CVS login using shell script

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)
Discussion started by: raghu_shekar
0 Replies

6. Shell Programming and Scripting

Help with Unix bash shell script login

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)
Discussion started by: tdsrogers
0 Replies

7. Shell Programming and Scripting

Login with Shell Script.

Dear All, 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... (7 Replies)
Discussion started by: Siddheshk
7 Replies

8. UNIX for Dummies Questions & Answers

How to authenticate sybase login thru shell script ?

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)
Discussion started by: libin4u2000
3 Replies

9. Shell Programming and Scripting

remote-login via Shell-Script

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)
Discussion started by: Juergen Paepke
1 Replies

10. UNIX for Dummies Questions & Answers

remote login via shell script

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)
Discussion started by: lethe
4 Replies
Login or Register to Ask a Question