Operating System - HP-UX
1847253 Members
3970 Online
110263 Solutions
New Discussion

FTP connects to wrong account

 
Raynald Boucher
Super Advisor

FTP connects to wrong account

Hello all,

This post is to learn how the connection process actually works.

.netrc contains:
machine target1 login user1 password passwd1
machine target2 login user2 password passwd2

all connections work when /etc/hosts contains:
ip_address1 local
ip_address2 target1
ip_address2 target2

all connections work when /etc/hosts contains:
ip_address1 local target1 target2

connections to target2 are established as user1 when /etc/hosts contains:
ip_address1 local
ip_address2 target1 target2

Can someone explain (or point me to) the sequence of steps to establish a connection?

Is there a configuration setting to correct the situation (besides the 2 lines in /etc/hosts)?

Thanks
6 REPLIES 6
Torsten.
Acclaimed Contributor

Re: FTP connects to wrong account

target1 and target2 are different machines???

Maybe I don't understand this, but it looks to me like a duplicated IP address.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Raynald Boucher
Super Advisor

Re: FTP connects to wrong account

Target1 and traget2 are the same machine but the aliases are used to login as different users.

We want to connect as user1 when we ftp to target1 and we want to connects as user2 when we ftp to target2.
Ivan Ferreira
Honored Contributor

Re: FTP connects to wrong account

>>> Can someone explain (or point me to) the sequence of steps to establish a connection?

I'm not sure about what additional information you need, so, for now, please see:

http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node52.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Raynald Boucher
Super Advisor

Re: FTP connects to wrong account

I need to understand --why--
connections to target2 are established as user1 (instead of user2) when both target aliases are on the same line in the /etc/hosts file
but
connections to target2 are established as user2 (correctly) when the aliases are in separate lines in the /etc/hosts file.
Raynald Boucher
Super Advisor

Re: FTP connects to wrong account

Solution found... in the man pages!

The server name must appear last in the .netrc file when an alias is also referenced.

Raynald Boucher
Super Advisor

Re: FTP connects to wrong account

Thread closed
Thanks