If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > AutoLogin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-24-05, 10:28
amolbchougule amolbchougule is offline
Registered User
 
Join Date: Jun 2004
Posts: 9
AutoLogin

Hi,

I am trying to make a connection to a remote machine using the "login" command. I want to use this in a script but i am not able to make out how i would provide the password required for it.

i was just wondering is there is any option in login command thats lets me pass the password in the command line itself.

or something like

# echo "mypassword" | login -h myserver.com
or
# login -h myserver.com < mypasswordfile.txt

Can anyone help me in this.

Thanks,
Amol C
Reply With Quote
  #2 (permalink)  
Old 02-24-05, 11:05
vjkiran vjkiran is offline
Registered User
 
Join Date: Feb 2005
Posts: 10
You can do this way

If you want o ftp Or Login
1.write the below line in a test.sh file
ftp -nv XXX.XXX.XXX.XX ( Ipaddress or hostname, ftp or telnet)

2.and create test1.txt file with the login information

user username password
command1
command2
close

3. execute this line
/fullpath/test.sh < /fullpath/test1.txt

I hope this works for you

Vijay
Reply With Quote
  #3 (permalink)  
Old 02-24-05, 12:42
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,454
I guess you should use rexec instead; you can't login to a remote host using login. Read rexec's manual page to learn how to specify remote user name and password using .netrc file.
Reply With Quote
  #4 (permalink)  
Old 02-25-05, 02:52
amolbchougule amolbchougule is offline
Registered User
 
Join Date: Jun 2004
Posts: 9
hmmm

hey guys thanks for the prompt reply...

well i am not going for FTP instead wanted to login into remote machine using a script....i had used rlogin for such a thing but was wodnering if we can do it the other way without having to edit the /etc/hosts file and the like.

anyways thanks a lot pals....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On