Results 1 to 4 of 4

Thread: AutoLogin

  1. #1
    Join Date
    Jun 2004
    Posts
    9

    Unanswered: 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

  2. #2
    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

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

  4. #4
    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •