Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris 9 FTP Trouble 2

Status
Not open for further replies.
Feb 3, 2006
3
0
0
US
Hello,

I'm having trouble with ftp running on solaris 9 sparc. I'm getting the following error when attempting to connect to the server: "421 Service not available, remote server has closed connection".
Being that I'm not real familiar with ftp config I'm not certain which files to check other than /etc/inetd.conf, which looks fine.

Running a truss on ftp localhost produces: (I've included section where errors start)



open("/usr/platform/SUNW,UltraSPARC-IIi-cEngine/lib/libc_psr.so.1", O_RDONLY) = 3
mmap(0xFF390000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xFF390000
close(3) = 0
munmap(0xFF390000, 8192) = 0
context(2, 0xFFBFF36C)
getrlimit(RLIMIT_STACK, 0xFFBFF364) = 0
getcontext(0xFFBFF1A0)
context(3, 0xFF243944)
sysconfig(_CONFIG_PAGESIZE) = 8192
brk(0x00038F00) = 0
brk(0x00040F00) = 0
open("/etc/netconfig", O_RDONLY|O_LARGEFILE) = 3
fcntl(3, F_DUPFD, 0x00000100) Err#22 EINVAL
read(3, " # p r a g m a i d e n".., 1024) = 1024
read(3, " t s t p i _ c".., 1024) = 215
read(3, 0x00038F18, 1024) = 0
lseek(3, 0, SEEK_SET) = 0
read(3, " # p r a g m a i d e n".., 1024) = 1024
read(3, " t s t p i _ c".., 1024) = 215
read(3, 0x00038F18, 1024) = 0
close(3) = 0
open("/dev/udp", O_RDONLY) = 3
ioctl(3, 0xC00C6982, 0xFFBFF10C) = 0
close(3) = 0
open("/etc/nsswitch.conf", O_RDONLY|O_LARGEFILE) = 3
fcntl(3, F_DUPFD, 0x00000100) Err#22 EINVAL
read(3, " #\n # / e t c / n s s".., 1024) = 1024
read(3, " k e n d f o r n e t".., 1024) = 273
read(3, 0x0003E430, 1024) = 0
close(3) = 0
stat("/usr/lib/nss_files.so.1", 0xFFBFEA80) = 0
resolvepath("/usr/lib/nss_files.so.1", "/usr/lib/nss_files.so.1", 1023) = 23
open("/usr/lib/nss_files.so.1", O_RDONLY) = 3
mmap(0x00010000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF270000
mmap(0x00010000, 98304, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF250000
mmap(0xFF250000, 19186, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xFF250000
mmap(0xFF266000, 1744, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 24576) = 0xFF266000
munmap(0xFF256000, 65536) = 0
memcntl(0xFF250000, 6276, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3) = 0
munmap(0xFF270000, 8192) = 0
open("/etc/services", O_RDONLY) = 3
fstat64(3, 0xFFBFEE88) = 0
brk(0x00040F00) = 0
brk(0x00042F00) = 0
fstat64(3, 0xFFBFED30) = 0
ioctl(3, TCGETA, 0xFFBFEE14) Err#25 ENOTTY
read(3, " # i d e n t\t " @ ( # )".., 8192) = 4774
llseek(3, 0xFFFFFFFFFFFFEEF2, SEEK_CUR) = 408
close(3) = 0
ioctl(0, TCGETA, 0xFFBFF24C) = 0
fstat64(0, 0xFFBFEF10) = 0
ioctl(0, TCGETA, 0xFFBFEE9C) = 0
stat64("/dev/tty", 0xFFBFEE18) = 0
stat64("/dev/console", 0xFFBFEE18) = 0
stat64("/dev/conslog", 0xFFBFEE18) = 0
stat64("/dev/syscon", 0xFFBFEE18) = 0
stat64("/dev/systty", 0xFFBFEE18) = 0
stat64("/dev/wscons", 0xFFBFEE18) = 0
stat64("/dev/ptmx", 0xFFBFEE18) = 0
stat64("/dev/ttyp0", 0xFFBFED10) = 0
stat64("/dev/ptyp0", 0xFFBFED10) = 0
open("/etc/ttysrch", O_RDONLY) = 3
fstat64(3, 0xFFBFED10) = 0
read(3, " # i d e n t\t " @ ( # )".., 1400) = 1400
close(3) = 0
stat64("/dev/pts/1", 0xFFBFED10) = 0
open("/var/adm/utmpx", O_RDONLY) = 3
fstat64(3, 0xFFBFEE50) = 0
fstat64(3, 0xFFBFECF8) = 0
ioctl(3, TCGETA, 0xFFBFEDDC) Err#25 ENOTTY
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0".., 8192) = 3348
llseek(3, 0, SEEK_CUR) = 3348
close(3) = 0
open64("/var/adm/utmpx", O_RDONLY) = 3
llseek(3, 2976, SEEK_SET) = 2976
read(3, " i f r a n c d\0\0\0\0\0".., 372) = 372
close(3) = 0
open64("/var/run/name_service_door", O_RDONLY) = 3
fcntl(3, F_SETFD, 0x00000001) = 0
door_info(3, 0xFF242668) = 0
door_call(3, 0xFFBFED90) = 0
getcontext(0xFFBFF098)
sigfillset(0xFF2427F0) = 0
sigaction(SIGALRM, 0xFFBFF180, 0xFFBFF220) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF250, 0xFFBFF240) = 0
getcontext(0xFFBFF098)
sigaction(SIGINT, 0xFFBFF180, 0xFFBFF220) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF250, 0xFFBFF240) = 0
sigaction(SIGPIPE, 0xFFBFF180, 0xFFBFF220) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF250, 0xFFBFF240) = 0
open("/dev/udp", O_RDONLY) = 4
ioctl(4, 0xC00C6982, 0xFFBFF0C4) = 0
ioctl(4, 0xC00C6982, 0xFFBFF0C4) = 0
so_socket(PF_INET6, SOCK_STREAM, IPPROTO_IP, "", 1) = 5
connect(5, 0x00035978, 32, 1) = 0
getsockname(5, 0x00035A94, 0xFFBFF1B4, 1) = 0
ioctl(1, TCGETA, 0xFFBFE33C) = 0
fstat64(1, 0xFFBFE258) = 0
Connected to localhost.
write(1, " C o n n e c t e d t o".., 24) = 24
sigaction(SIGINT, 0xFFBFEFF8, 0xFFBFF098) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF0C8, 0xFFBFF0B8) = 0
fstat64(5, 0xFFBFEF18) = 0
fstat64(5, 0xFFBFEDC0) = 0
ioctl(5, TCGETA, 0xFFBFEEA4) Err#22 EINVAL
read(5, 0x000406A4, 8192) = 0
sigaction(SIGINT, 0xFFBFEF38, 0xFFBFEFD8) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF008, 0xFFBFEFF8) = 0
sigaction(SIGINT, 0xFFBFEF38, 0xFFBFEFD8) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF008, 0xFFBFEFF8) = 0
sigaction(SIGINT, 0xFFBFEF98, 0xFFBFF038) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF068, 0xFFBFF058) = 0
sigaction(SIGINT, 0xFFBFEF98, 0xFFBFF038) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF068, 0xFFBFF058) = 0
421 Service not available, remote server has closed connection
write(1, " 4 2 1 S e r v i c e ".., 63) = 63
llseek(5, 0, SEEK_CUR) Err#29 ESPIPE
close(5) = 0
close(5) Err#9 EBADF
close(5) Err#9 EBADF
getcontext(0xFFBFF098)
sigaction(SIGINT, 0xFFBFF180, 0xFFBFF220) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF250, 0xFFBFF240) = 0
sigaction(SIGPIPE, 0xFFBFF180, 0xFFBFF220) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF250, 0xFFBFF240) = 0
ftp> write(1, " f t p > ", 5) = 5
ioctl(0, TCGETA, 0xFFBFF094) = 0
fstat64(0, 0xFFBFEFB0) = 0
read(0, 0xFF24353C, 1024) (sleeping...)
quit
read(0, " q u i t\n", 1024) = 5
sigaction(SIGINT, 0xFFBFF060, 0xFFBFF100) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF130, 0xFFBFF120) = 0
sigaction(SIGINT, 0xFFBFF060, 0xFFBFF100) = 0
sigprocmask(SIG_UNBLOCK, 0xFFBFF130, 0xFFBFF120) = 0
_exit(0)
[ifrancd@ccap77]:/export/home/ifrancd
#

thanks again!
 

You kind of know what ftp is saying, so truss in this direction is useless.

Instead, truss inetd with the -f option, if inetd is pid 916,

% cd /tmp
% script
Script started, file is typescript (so you can save the output)
% truss -f -p 916

then invoke "ftp localhost" from a window that isn't passing through inetd. ssh is a candidate, or xterm,
or the console. We don't want the test to spit stuff in the truss. Or use the console for the truss and invoke
the ftp from an external host.

The truss should tell you what files or calls, the most often call is like getvalidshell which indicates a problem with /etc/shells or a call to open ftpusers.

gene



 
First you need to make sure the FTP daemon is running on the server you are trying to get to. Log onto that server. and do the following...
Code:
pgrep -l ftpd
If it's running, you should get something like this back...
Code:
26877 in.ftpd
If it's not running, you won't get anything back from the [tt]pgrep[/tt] command.

If it's not running, do the following. Go to the directory [tt]/etc/inet[/tt] and look for the file [tt]inetd.conf[/tt]. Make sure this line is NOT commented out...
Code:
ftp   stream  tcp6   nowait  root  /usr/sbin/in.ftpd   in.ftpd
Then do this to have the [tt]inetd[/tt] daemon reread it's config file...
Code:
kill -HUP `pgrep inetd`

If you seem to be connecting, but it's not letting you log in, go to the directory [tt]/etc/ftpd[/tt] and look at the file [tt]ftpusers[/tt]. The user you're trying to log on as should NOT be listed in this file.

Hope this helps.
 

I skipped checking inetd step because the truss output has
a write to stdout saying "Connected", which leads me to believe it connected to something!

I would still truss inetd to figure out what is happening.
If there is no output and someone is listening on the ftp command port (21), then I would use "lsof" to figure out which process is listening.

Oh, did you install tcpwrappers? That could give this behaviour.

gene

 
Make sure the ftpusers file does not contain the userid your using. File is located in /etc/ftpd/ftpusers.

Any user ID present in this file will prevent FTP from initiating or receiving an FTP session. You can comment out or remove your userid from this file.
 
Make sure the ftpusers file does not contain the userid your using. File is located in /etc/ftpd/ftpusers.

Any user ID present in this file will prevent FTP from initiating or receiving an FTP session. You can comment out or remove your userid from this file.

 

No a ftpusers entry would not return "Service Unavailable".

I would return "Login Incorrect" or some such.

gene
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top