1827741 Members
3168 Online
109969 Solutions
New Discussion

Re: ftp issue

 
SOLVED
Go to solution
infarakesh
Advisor

ftp issue

Unabel to enable ftp.

errors observed:

1) inetd[1501]: ftp/tcp: Unknown service
2) # ftp 0
ftp: connect: Connection refused
ftp>


inputs:

1) # grep -i ftp services
ftp-data 20/tcp # File Transfer Protocol (Data)
ftp 21/tcp # File Transfer Protocol (Control)
tftp 69/udp # Trivial File Transfer Protocol
sftp 115/tcp # Simple File Transfer Protocol
bftp 152/tcp # Background File Transfer Protocol
ftp-ftam 8868/tcp # FTP->FTAM Gateway

2) # grep -i ftp inetd.conf
#ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 22
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l
ftp stream tcp6 nowait root /usr/lbin/ftpd ftpd -l
# Before uncommenting the "tftp" entry below, please make sure
# that you have a "tftp" user in /etc/passwd. If you don't
# have one, please consult the tftpd(1M) manual entry for
#tftp dgram udp wait root /usr/lbin/tftpd tftpd
#


3) # ls -l /usr/lbin/ftpd
-r-xr--r-- 1 bin bin 610120 Nov 10 2006 /usr/lbin/ftpd
#


4) # ls -l services
-rw-r--r-- 1 bin bin 11545 May 31 14:53 services
30 REPLIES 30
infarakesh
Advisor

Re: ftp issue

HP-UX B.11.23 U ia64 0242525198 unlimited-user license
#
infarakesh
Advisor

Re: ftp issue

# netstat -an|grep '*.21'
tcp 0 0 *.2121 *.* LISTEN
tcp 0 0 *.2148 *.* LISTEN
udp 0 0 *.2121 *.*
udp 0 0 *.2148 *.*
#
Patrick Wallek
Honored Contributor

Re: ftp issue

There appears to be an error either in /etc/services or /etc/inetd.conf as there does not appear to be anything listening on port 21.

Are there any error messages in /var/adm/syslog/syslog.log?

Can you try running an 'inetd -c' and see what errors are reported and whether or not anything is generated in syslog.log?

Steven Schweda
Honored Contributor

Re: ftp issue

> # netstat -an|grep '*.21'
> [...]

Well, yeah. "Connection refused" made it
pretty clear that you aren't running the FTP
server.

> 1) # grep -i ftp services
> ftp-data 20/tcp # File Transfer Protocol (Data)
> ftp 21/tcp # File Transfer Protocol (Control)
> [...]

Assuming that "services" was "/etc/services",
then that looks ok to me.

> 1) inetd[1501]: ftp/tcp: Unknown service

If "/etc/services" is ok, but you get a
complaint like "Unknown service", then my
guess would be that you're not looking at the
same "services" data as inetd is. Are you
running NIS? LDAP? (Something else about
which I know nothing?)

cat /etc/nsswitch.conf

What's the history of this problem? Did FTP
ever work before on this system? What's
changed recently?
infarakesh
Advisor

Re: ftp issue

getting the below errors whle doing "inetd -c"

May 31 15:51:42 inescape inetd[1501]: Rereading configuration
May 31 15:51:42 inescape inetd[1501]: ftp/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: telnet/tcp: Unknown service
May 31 15:51:24 inescape syslog: gethostbyaddr: inx174303.informatica.com. != 10.65.2.76
May 31 15:51:42 inescape above message repeats 3 times
May 31 15:51:42 inescape inetd[1501]: login/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: shell/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: ftp/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: exec/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: ntalk/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: auth/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: printer/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: daytime/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: daytime/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: time/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: echo/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: echo/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: discard/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: discard/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: chargen/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: chargen/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: kshell/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: klogin/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: recserv/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: dtspc/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: swat/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: hacl-probe/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: registrar/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: hacl-cfg/udp: Unknown service
May 31 15:51:42 inescape inetd[1501]: hacl-cfg/tcp: Unknown service
May 31 15:51:42 inescape inetd[1501]: Configuration complete

Steven Schweda
Honored Contributor

Re: ftp issue

> May 31 15:51:42 inescape inetd[1501]: : Unknown service

Sounds like a "services" data base problem,
doesn't it?
infarakesh
Advisor

Re: ftp issue

ftp never worked I guess.

This machine is of NIS client.

# ypwhich
spyder.xxxxx

nsswitch.conf file never existed. I added an hr back.. no luck though

# cat /etc/nsswitch.conf
#
# /etc/nsswitch.nis:
#
# @(#)B11.23_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#

passwd: files nis
group: files nis
hosts: nis [NOTFOUND=return] files
ipnodes: files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: files nis
#
infarakesh
Advisor

Re: ftp issue

I understood that it's services problem.. how to correct it?

In fact, I restored the original file w/o any luck
infarakesh
Advisor

Re: ftp issue

# cat /etc/nsswitch.conf|grep -i services
services: files nis
#

Patrick Wallek
Honored Contributor

Re: ftp issue

Yep, it does.

Check /etc/nsswitch.conf and see what the services line looks like.

It should look something like:

services: files

If there is something like NIS there, then you need to check your NIS maps.

Steven Schweda
Honored Contributor

Re: ftp issue

> ftp never worked I guess.

"I guess" does not inspire much confidence.
What _does_ work on this system?

> This machine is of NIS client.

So, instead of "cat /etc/services", what do
you get from:
ypcat services
?

Where's the NIS master? Do other NIS clients
work better than this one?

> In fact, I restored the original file w/o
> any luck

Which file is that? Restored what? My
psychic powers are very weak. Guessing that
you might be using NIS is about the best
you'll get from me if you want to depend on
me to guess at this stuff.
infarakesh
Advisor

Re: ftp issue

1) server works normally. Issues observing with telnet, ftp

2) # ypcat services
ypcat: no such map in server's NIS domain
#

3) restored services file from /usr/newconfig/etc/services.. which I feel is the original one from OS build

Steven Schweda
Honored Contributor

Re: ftp issue

> In fact, I restored the original file w/o
> any luck

Also, "w/o any luck" is not a very detailed
description of what you tried, or what
happened when you tried it.

Knowing nothing, I'd guess that after you
change the nsswitch configuration, you'd need
to whack inetd to get it to try everything
again.
infarakesh
Advisor

Re: ftp issue

yes.. no luck means.. updated those changes and tried to check ftp and it did not work
Steven Schweda
Honored Contributor

Re: ftp issue

> 2) # ypcat services
> ypcat: no such map in server's NIS domain

Really? That seems unusual. But, if there's
no NIS "services" map, then you probably want
an nsswitch.conf which says
services: files
instead of
services: files nis

> It should look something like:
>
> services: files

What he said.

Also potentially interesting:

ypwhich -m
infarakesh
Advisor

Re: ftp issue


# ypwhich -m
netgroup.byuser yellow
netgroup.byhost yellow
netgroup yellow
ypservers yellow
group.byname yellow
group.bygid yellow
auto_home yellow
auto_master yellow
auto_direct yellow
passwd.byuid yellow
passwd.byname yellow
netid.byname yellow
hosts.byname yellow
hosts.byaddr yellow
publickey.byname yellow
# cat /etc/nsswitch.conf|grep -i services
services: files
#

Steven Schweda
Honored Contributor

Re: ftp issue

> yes.. no luck means.. updated those
> changes and tried to check ftp and it did
> not work

Which "those changes"? "tried to check" how,
exactly? As usual, showing actual commands
with their actual output can be more helpful
than vague descriptions or interpretations.

Was there another "inetd -c" in there
anywhere?


The whole Forum points system may not be
worth much, but it might make more sense if
you waited until you found the solution to
your problem before deciding how helpful a
particular response was.
infarakesh
Advisor

Re: ftp issue

can we concentrate on only technical stuff?


see my earlier reply and if you can respond back.. thanks!
Steven Schweda
Honored Contributor

Re: ftp issue

> # ypwhich -m
> [...]

You win. No "services.byname". So you need
to use the "/etc/services" _file_.
Steven Schweda
Honored Contributor

Re: ftp issue

> can we concentrate on only technical stuff?

I'd like to, but with my weak psychic powers,
I can't see what you're doing, and you're not
telling me what I want to know, that is, what
you're doing, and what happens when you do
it.
infarakesh
Advisor

Re: ftp issue

> # ypwhich -m
> [...]

You win. No "services.byname". So you need
to use the "/etc/services" _file_.

so.. what's the next step??

only 1 inetd

# ps -aef|grep -i inetd
root 1501 1 0 May 25 ? 0:05 /usr/sbin/inetd
root 21691 14807 0 16:43:47 pts/1 0:00 grep -i inetd
#


tell me if you have any technique to find if I am running other "inetd -c"
Steven Schweda
Honored Contributor

Re: ftp issue

> tell me if you have any technique to find
> if I am running other "inetd -c"

"inetd -c" tells the real running inetd to
re-read its configuration.

man inetd

You could also re-boot the system to restart
inetd, but that shouldn't be necessary.
infarakesh
Advisor

Re: ftp issue

did "inetd -c" still getting the same errors

May 31 17:00:50 inescape inetd[1501]: Rereading configuration
May 31 17:00:50 inescape inetd[1501]: ftp/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: telnet/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: login/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: shell/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: ftp/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: exec/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: ntalk/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: auth/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: printer/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: daytime/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: daytime/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: time/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: echo/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: echo/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: discard/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: discard/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: chargen/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: chargen/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: kshell/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: klogin/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: recserv/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: dtspc/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: swat/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: hacl-probe/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: registrar/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: hacl-cfg/udp: Unknown service
May 31 17:00:50 inescape inetd[1501]: hacl-cfg/tcp: Unknown service
May 31 17:00:50 inescape inetd[1501]: Configuration complete
Steven Schweda
Honored Contributor

Re: ftp issue

> did "inetd -c" still getting the same errors

What have you changed? What's in
/etc/services
/etc/nsswitch.conf
now?