Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I want to automate authentiation process on UNIX. suppose i have a script test.sh in that i have coded for ftp to another computer. Now i want the script ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Location
    New Delhi. INDIA
    Posts
    6

    how to automate authentication through shell script ??


    Hi,

    I want to automate authentiation process on UNIX.
    suppose i have a script test.sh in that i have coded for ftp to
    another computer. Now i want the script should not ask me for the
    username and password and automatically get the username and
    password from somewhere else (hard code).
    what is the way to do so ??

  2. #2
    Linux Newbie
    Join Date
    May 2005
    Location
    Chennai,TamilNadu, India
    Posts
    141
    Try this

    Code:
    #!/bin/sh
    HOST='10.0.3.71' # change the ipaddress accordingly
    USER='user1' # username also change
    PASSWD='user1' # password also change
    ftp -n $HOST <<END_SCRIPT
    quote USER $USER
    quote PASS $PASSWD
    # add more commands here for ftp usage like transfer of data
    ...
    ...
    quit
    END_SCRIPT

  3. #3
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Is using ftp a requirement? (i.e. Is the server not in your control?)

    If so, remember to tighten up permissions on the script to go-rwx.

  4. #4
    Just Joined!
    Join Date
    Nov 2005
    Location
    New Delhi. INDIA
    Posts
    6

    Thanks dear sharonenoch

    Hey sharonenoch

    thanks yaar ....it works.

    regards
    always nandan

Posting Permissions

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