openssh and tcpserver
hasenhei_at_gmail.com
Date: 05/25/05
- Next message: Darren Tucker: "Re: openssh on os400 or aix"
- Previous message: hanjar: "SSH Socket Programming ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 25 May 2005 04:04:50 -0700
Hi, I have an ssh-server (openssh-3.9_p1-r2) maintained by tcpserver
(from DJB's ucspi-tcp-0.88-r10) on a gentoo-machine.
The server is run from this script:
----------------------------------------
!/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin
export PATH
exec tcpserver -vRp -l ser.ver.ip.addr -x /etc/tcp.sgw.cdb \
-c5 -u0 -g0 ser.ver.ip.addr 2281 /usr/sbin/sshd -ieD -f
/etc/sgw/sshd_config 2>&1
----------------------------------------
The service works just fine, apart from the problem that sshd seems
not to be able to recognize the the client address.
Looking at the log:
@400000004291fa1e18d55684 tcpserver: status: 1/5
@400000004291fa1e18da28e4 tcpserver: pid 3672 from cli.ent.ip.addr
@400000004291fa1e19b8194c tcpserver: ok 3672
ser.ver.ip.addr:ser.ver.ip.addr:2281
client.my.net:cli.ent.ip.addr::51990
@400000004291fa1e1a77fa64 debug1: inetd sockets after dupping: 3, 4
@400000004291fa1e1a7afbec Connection from UNKNOWN port 65535
@400000004291fa1e1d6a1cfc debug1: Client protocol version 2.0; client
software version OpenSSH_4.0
@400000004291fa1e1d6adc64 debug1: match: OpenSSH_4.0 pat OpenSSH*
I wouldn't say a lot about this, if I wouldn't know that on an other
gentoo-machine (same software-version of openssh and ucspi-tcp, same
script, similar sshd_config, similar gentoo USE-FLAGS), this works just
fine.
For debugging purposes I started sshd with strace, and I found this:
@400000004291f29f1bf7437c setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1],
4) = 0
@400000004291f29f1bf94b04 getpeername(3, {sa_family=AF_INET,
sin_port=htons(37115), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291f29f1bfae914 getpeername(4, {sa_family=AF_INET,
sin_port=htons(37115), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291f29f1bfc63fc getpeername(3, {sa_family=AF_INET,
sin_port=htons(37115), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291f29f1bfddafc getpeername(4, {sa_family=AF_INET,
sin_port=htons(37115), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291f29f1bffea54 write(2, "Connection from UNKNOWN port
655"..., 36Connection from UNKNOWN port 65535^M
... and of course "UNKOWN" is written to /var/log/wtmp ...
while on the other machine the strace looks like this:
@400000004291cded2ce5ef44 setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1],
4) = 0
@400000004291cded2ce7a0dc getpeername(3, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2ce917dc getpeername(4, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2cea3504 getpeername(3, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2cebd314 getpeername(3, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2cecffdc getpeername(4, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2cee191c getpeername(3, {sa_family=AF_INET,
sin_port=htons(50654), sin_addr=inet_addr("cli.ent.ip.addr")}, [16]) =
0
@400000004291cded2cefe224 write(2, "Connection from cli.ent.ip.addr
por"..., 41Connection from cli.ent.ip.addr port 50654^M
... and everything is just the way it should be!
Im not sure if this problem is related to these getpeername-calls at
as they obviously do not fail, but this is the only difference I can
see.
Has anybody got an idea ?
Or can anybody tell me where I should continue with debugging...
Thank you!
Hasenhei
- Next message: Darren Tucker: "Re: openssh on os400 or aix"
- Previous message: hanjar: "SSH Socket Programming ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]