Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2004
    Posts
    143

    Unanswered: ftp without a username and password

    I have a server DEV1 which has some files that needs to be transferred via ftp to servers DEV2 and DEV3. The user performing the ftp on DEV1 is Mike and is logging into DEV2 and DEV3 as user Chug



    I log in to DEV1 with the username called Mike. And as Mike, I issue the ftp command

    ftp DEV2

    I get

    Enter PASSCODE at the Password: prompt.
    230 User chug logged in.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp>



    Thus, the user chug is automatically logged in without providing a username and password!! This is great and this is what I wanted on DEV3 also.


    But to DEV3 (from DEV1), when I do the same -

    ftp DEV3
    I am asked for username and password -

    (Here i can enter chug and its password, but i didn't want it to ask me for username and password). Is this something that can be set up on DEV3 so that from DEV1 when I say "ftp DEV3" user chug is logged in automatically

    Thanks

  2. #2
    Join Date
    Oct 2003
    Posts
    19
    On machine DEV1 login using the id "mike" and go to the home directory .
    Open the file called .netrc . If not there create one .
    Inside that put the following :

    machine <remote machine name> login <userid> password <password>

    for e.g
    machine DEV3 login chug password welcome

    Save and exit from the file .

    now on the command prompt try
    ftp DEV3 ...
    U should be able to log in to DEV3 as chug

  3. #3
    Join Date
    Feb 2004
    Posts
    143
    Thanks a lot. That worked

  4. #4
    Join Date
    May 2004
    Posts
    2

    I followed the same steps but got an error

    I followed the same steps but got an error 'Error - .netric file not correct mode. Remove passowrd or correct mode.' How to fix this up.

  5. #5
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    ~/.netrc != ~/.netric

  6. #6
    Join Date
    Feb 2004
    Posts
    143
    Hello send2sridhar
    Vgersh is right. The file should be .netrc and not .netric
    and should be in your home directory

  7. #7
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    138
    Quote Originally Posted by send2sridhar
    I followed the same steps but got an error 'Error - .netric file not correct mode. Remove passowrd or correct mode.' How to fix this up.
    set the permissions from the file "chmod 400 .netrc" (r--------)
    Greetings from germany
    Peter F.

  8. #8
    Join Date
    May 2004
    Posts
    2

    Its Worked!Thanks a Lot Mate

    Its Worked!Thanks a Lot Mate . However there's a new problem, I am trying to write a shell script to run ftp process as a exe file. The problem is the commands r working fine in the unix mode but they r not working when the system enters ftp mode. Say this is the following code

    ftp 10.80.20.38
    bin
    hash
    prompt off
    cd test
    put
    -------------------

    I want to change the directory on the remote machine before putting the files there. However none of these commands work other than the ftp command, it logs me on to the remote machine(since I have enabled .netrc file), but thats it. I hope some body can help me.

  9. #9
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    Code:
    ftp 10.80.20.38 <<EOF
    bin
    hash
    prompt off
    cd test
    mput *
    EOF

  10. #10
    Join Date
    May 2004
    Location
    New York
    Posts
    248
    take a look at the man ftp look at the in flag
    i beleve it is done something like this

    ftp -in ipaddress <<EOF
    username
    password
    cd directory
    put or get
    bye
    EOF

Posting Permissions

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