Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Unanswered: .netrc has two machine names with same name

    I am having difficulties trying to figure out how to use the .netrc to login to a server where I already have the same server name for another ftp file.
    For example, my .netrc would look like this:

    machine 111.11.1.1 login idone password passone
    machine 111.11.1.1 login idtwo password passtwo

    When logging in with "idone" I am able to get to certain files, and when logging in with "idtwo" I am able to get to other files. The problem is that I cannot login with "idone" to get the "idtwo" files and visa-versa. When executing the script, it will obviously take the id and password of the first entry it comes to. Any thoughts?
    Some other factors...I am using tlsftp to transfer these files. I have tried hardcoding the ftp command into my unix script (bypassing the .netrc file), but I keep getting errors. Unfortunatly my work installed tlsftp, but has no supporting documentation on it.
    Any help you could provide would be greatly appreciated.

  2. #2
    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    28
    You must use a unique "machine" name in the .netrc. Try using the domain name of the server as an alternate entry.

    You can find it by doing an nslookup:

    nslookup 207.46.250.119

    will return something like this:

    Name: microsoft.com
    Address: 207.46.250.119

    Then use that name in the .netrc file for one of your entries.

    machine 207.46.250.119 login idone password passone
    machine microsoft.com login idtwo password passtwo

    Even though they both will go to the same place, you can use seperate logins for each since the machine name is different.
    Last edited by Bob4480; 02-23-06 at 02:44.

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Edit your /etc/hosts to assign multiple hostnames to your server's ip address, then use those aliases as machine names in .netrc

  4. #4
    Join Date
    Mar 2004
    Posts
    3
    Thanks Bob, I will give that a try and post back the results.
    As a side note I also tried just putting the code into my unix script (by-passing the .netrc), but it doesn't like the standard code:
    tlsftp -v << EOF
    open 111.11.1.1
    user idone passone
    put filename
    quit
    EOF

    Do you know if secure ftp works differently? I tried looking this up on the web but have not had any luck thus far.
    Thanks for your help...any assistance anyone can provide on this would be greatly appreciated.

  5. #5
    Join Date
    Mar 2004
    Posts
    3
    I received an error message "Verify Error CN=...type mismatch!" when trying to use the ip address. I will now request to have my /etc/hosts file name changed. I think this will prove promising since my sys admin's knew exactly what I was trying to do. I will post my progress.
    Thanks for your assistance!

Posting Permissions

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