The second part of the question, how to get your IP as it is seen by server, can't be answered (that's what the passive mode is for). So, yes, you've gotten PORT command right, but there's no uniform way to get your external IP (there may be several your IPs in several different networks on local machine, there may be several gates with their own networks on the way to server, which one do you want to use?). FTP is a very old protocol (definition from circa 1970), defined when there were no routers, gates and other transport level goodies, usually there were several machines, directly connected, so the active mode worked quite well, the passive mode is how the protocol survives today. here client listens for an incoming connection on port 45*256+45 > connecting to the same server on port 185*256+37, specified by server:ĭrwxrwxr-x 7 0 1003 4096 Nov 09 21:04 pub The Linux ftp command uses the following basic syntax: ftp options IP The IP is the IP address of the system you are connecting to. > here client opens another telnet session, So, a passive mode session looks like this: $ telnet localhost 21Ģ27 Entering Passive Mode (127,0,0,1,185,37). It's often unpractical, so the passive mode was invented: server opens an additional port which listens for incoming connections and starts transmission when someone is connected. FTP active mode means that a server opens a connection to a client and sends data ifself.
0 Comments
Leave a Reply. |