redirecting password as username for rlogin


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers redirecting password as username for rlogin
# 1  
Old 05-12-2005
redirecting password as username for rlogin

Is the following even possible ? by echo $3, I mean enter password when prompted for it. My main issue is that it would deal with a prompted password, which is passed from the command line like this:

./processing serverA user password

I cannot not use expect here, I heard that was very useful. So please if any tips thanks very much
#bin/ksh

_mainProcessing()
{

_checkUsage $*
remoteLogin $server1 $dba1 $pw1


}

_checkUsage()
{



if [ -n "$1" ] && [ -n "$2" ] && [ -n "$3" ]
then

server1=$1
dba1=$2
pw1=$3

else

echo
echo " -- usage: table_check <server1> <dba1> <passwd1>"
echo

exit ${FALSE}

fi


}

remoteLogin ()
{
echo "starting login to $1 as $2 using password $3"

echo "$3
" | rlogin -n -l $2 $1


echo "finished login"
}

_mainProcessing $*
# 2  
Old 05-12-2005
No, that will not work.

A better way to deal with this, assuming you can't use a rhost setup, or ssh with key authentication would be to use expect.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Steps after username and password is entered !

Hi, I know this sounds crazy question.. but I am just curious to know what happens next when I enter username and password and hit enter on a new Unix session (using Putty)? I mean which file gets executed, how the default login shell is determined etc... regards juzz4fun (5 Replies)
Discussion started by: juzz4fun
5 Replies

2. UNIX for Dummies Questions & Answers

How do you reset username/password

Picked up a 3b2 running System V. Works fine, but it requires a username and password. Is the username "root" or "sysadm"? How do I find out and how to I reset it or bypass it? Thanks. (2 Replies)
Discussion started by: TanRuNomad
2 Replies

3. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

4. Shell Programming and Scripting

rlogin / ssh login with password

Hello, I need to find a way to connect from server1 to 30 other servers using a single line command in order to run various command from the other 30 servers. I am looking for a single line connection command in which i can provide the server name user name and password and connect to the... (2 Replies)
Discussion started by: LiorAmitai
2 Replies

5. UNIX for Dummies Questions & Answers

SSH version of rlogin (ie without password prompt)

I have 3 Solaris 10 UNIX servers, the shadow and passwd file are all identical and are automatically sync every 5 minutes. A majority of the users do not have CLI access but rather use a menu. I currently have menu options that allows them to rlogin to another server and I need to have the... (1 Reply)
Discussion started by: creedonjm
1 Replies

6. UNIX for Dummies Questions & Answers

How can i hide username/password

hi all, i run sqlplus command on unix(HP-UX) like "sqlplus username/password@serverA @deneme.sql" but when someone run "ps -ef | grep sqlplus", it can see my username and password :( How can i hide username and password. thanx. (1 Reply)
Discussion started by: temhem
1 Replies

7. Shell Programming and Scripting

in ftp how to avoid username/password

hi all i am very new to unix. we had the below scenior test.bat file which contains ftp -s:logfiles.scr servername logfiles.scr contains username password cd path get file bye We had n number of batch(.bat files). which is having the same kind of scr file pointing... (10 Replies)
Discussion started by: nh1
10 Replies

8. Shell Programming and Scripting

username password in script

Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script?? something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies

9. Shell Programming and Scripting

passing password to rlogin

I have access to seperate Unix server that has specific scripts that I need to run from time to time. What I would like to do is pass my password in the script, instead of having to type the password then run the script all from the original script. Is this possible? ;) (2 Replies)
Discussion started by: jagannatha
2 Replies

10. UNIX for Dummies Questions & Answers

redirecting username to finger

Hi, I have a file named 'uname' that contains just an username and try to redirect the content of the file to finger: $cat uname | finger But finger always shows info for all users, instead of just the one I have in the file. I would appreciate any help. Thanks, David (2 Replies)
Discussion started by: dhinojosa
2 Replies
Login or Register to Ask a Question