Re: ftp and /etc/services...
Donn Miller wrote: > This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection refused" > message when I try to login to anonymous ftp sites. Well _there's_ a surprise. > Should ftp be this dependent on /etc/services? Uh, yes, that's the whole _point_ of /etc/services, so you can dynamically get a port number rather than hardcoding it. Of course, the port number for things like ftp/http/smtp and the other popular protocols are very unlikely to ever change, but that's not the point. If you change port numbers in /etc/services, things will break. > What if you _have_ no services running, e.g. inetd & portmap? ?? What relevance does that have to your problem/question? -- Ben Smithurst / [EMAIL PROTECTED] / PGP: 0x99392F7D FreeBSD Documentation Project / To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
* Donn Miller ([EMAIL PROTECTED]) [000816 14:43]: > This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection > refused" message when I try to login to anonymous ftp sites. Should ftp > be this dependent on /etc/services? What if you _have_ no services > running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes > this problem. I posted earlier about my problems with ftp recently. The name to port mapping for a service is used by two processes on your system: the ftpd daemon and the ftp client. Modifying the port in /etc/services did move the daemon, but it also makes the client look up the new port when it wants to establish an outbound connection. Possible solutions: 1. If your FTP daemon can run in standalone mode, it may offer an option to change the port it listens on. 2. You can create an alternate service name with the new port in /etc/services ("myftp" for example), then change the entry in inetd.conf to make the daemon run on the alternate port. -- j. James FitzGibbon [EMAIL PROTECTED] Targetnet.com Inc. Voice/Fax +1 416 306-0466/0452 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
On Wed, 16 Aug 2000, Donn Miller wrote: > This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection > refused" message when I try to login to anonymous ftp sites. Should ftp > be this dependent on /etc/services? What if you _have_ no services > running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes > this problem. I posted earlier about my problems with ftp recently. > When you change ftp in /etc/services to 2121, you tell your machine, that ftp by default is running on port 2121 all over the world. What you want to do is _add_ a new service, eg spcl_ftp on port 2121 in /etc/services, and then in /etc/inetd.conf replace the keyword ftp with spcl_ftp: spcl_ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l If you have a standalone ftp-daemon (not invoked by inetd), you probably have a command-line option for specifying the port you want it to listen on. Leif To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
On Wed, 16 Aug 2000, Donn Miller wrote: :This is on a recently-built -current box. When I try to move ftp from :port 21 to port 2121 in /etc/services, I get a "Connection :refused" message when I try to login to anonymous ftp sites. Should ftp :be this dependent on /etc/services? What if you _have_ no services :running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes :this problem. I posted earlier about my problems with ftp recently. Yes. One would expect this. ftp(1) uses getservbyname(3), which looks at /etc/services to figure out what port to use. Since you've changed what getservbyname(3) returns to 2121, ftp(1) is trying to connect to the remote machine on port 2121. It's really quite unlikely they are running an ftp daemon there, so your connection is refused. This has absolutely nothing to do with what services your box runs, if inetd or portmap is running, or the phase of the moon. David To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
>This is on a recently-built -current box. When I try to move ftp from >port 21 to port 2121 in /etc/services, I get a "Connection >refused" message when I try to login to anonymous ftp sites. Should ftp >be this dependent on /etc/services? What if you _have_ no services >running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes >this problem. I posted earlier about my problems with ftp recently. /usr/bin/ftp depends on "ftp" line in /etc/services. you cannot just change it. itojun To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: ftp and /etc/services...
On 16-Aug-00 Donn Miller wrote: > refused" message when I try to login to anonymous ftp sites. Should ftp > be this dependent on /etc/services? What if you _have_ no services > running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes I think the answer to this is 'yes it should', /etc/services is just a port number to service name mapping with no connection to whatever services are running. The ftp client 'knows' it should talk to the ftp service and checks in /etc/services for the corresponding port number then makes a connection to that port on the specified host. If you were trying to get a local ftp server listening on port 2121 (no reason why not) then you would need to change inetd.conf (or rig the ftp server to run standalone on port 2121). To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
On Wed, 16 Aug 2000 05:39:33 -0400, Donn Miller wrote: > This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection > refused" message when I try to login to anonymous ftp sites. Sounds like ftp(1) is doing its job -- it defaults to using the ``ftp'' port, as resolved using the /etc/services file. If you insist on messing around withy /etc/services, then you can specify a port number to ftp(1) on the command line. See the -P option described in the ftp(1) manual page. If you're messing around with /etc/services just because you want to run ftpd(8) on a non-standard port, then I think you're going about it the wrong way. You should rather add a new service to /etc/services, called something like ``ftp-weird'', and then configure inetd(8) to launch ftpd(8) to handle connections to ``ftp-weird''. It's a little odd that ftpd(8) can be started and run as a listening daemon, and yet provides no option for specifying the port on which it should listen. Ciao, Sheldon. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
On Wed, Aug 16, 2000 at 05:39:33AM -0400, Donn Miller wrote: > This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection > refused" message when I try to login to anonymous ftp sites. Should ftp > be this dependent on /etc/services? What if you _have_ no services > running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes > this problem. I posted earlier about my problems with ftp recently. That's the behavior I would expect. If you want to connect to a specific service, you should look it up in /etc/services. Changing IANA registered services in the services file is asking for trouble. If you really want to change it, you can should be able to get away with specifying the correct port on the command line. -- Brooks -- Any statement of the form "X is the one, true Y" is FALSE. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: ftp and /etc/services...
> This is on a recently-built -current box. When I try to move ftp from > port 21 to port 2121 in /etc/services, I get a "Connection > refused" message when I try to login to anonymous ftp sites. Should ftp > be this dependent on /etc/services? What if you _have_ no services > running, e.g. inetd & portmap? Returning ftp to port 21 in services fixes > this problem. I posted earlier about my problems with ftp recently. Yes! From man 5 services: The services file contains information regarding the known services available in the DARPA Internet. For each service a single line should be present with the following information: If you wish to have your ftp-service on a diffrent port you simply tell inetd to use that port in inetd.conf. /etc/services is not only used by inetd. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message