What do the 2 last numbers between '()' mean in 227 response to “ls” command?

3

1

This question is related to FTP tool that can be found here: ftp://ftp.linux.org.uk/pub/linux/Networking/netkit

If I run a command such like ls the output is the following:

227 Entering Passive Mode (192,0,2,1,104,31)

What do the 2 last numbers between () mean?

sebelk

Posted 2019-09-19T22:51:28.180

Reputation: 217

Answers

6

That is the raw message from the FTP server, it's not generated by your client (netkit).

The last two numbers are the two bytes that comprise the remote port for the passive data connection.

In this case, the remote port is (104 << 8) + 31, or (104 * 256) + 31 or 26655.

Nathan Dorfman

Posted 2019-09-19T22:51:28.180

Reputation: 76

2nice first answer! – ivanivan – 2019-09-19T23:14:53.043