John Wolford <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have a question that might be off-topic for this list, but then again
> maybe not. How can i tell if a given sshd process is serving ssh? Other than trying
>to connect to
> it, that is.
Well, how about asking netstat -a if there is a process listening on
port 22? That still won't guarantee that its DOING anything good
there ;-), but at least you'll know that its out there trying.
Be sure to egrep out the connection's entries!
e.g:
'netstat -a' says (partially)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost.localdom:pop3 *:* LISTEN
tcp 0 0 localhost.localdom:pop2 *:* LISTEN
tcp 0 0 dhcp2.foobar.com:ssh foobar.barfoo.com:991 ESTABLISHED
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 *:auth *:* LISTEN
raw 0 0 *:icmp *:* 7
raw 0 0 *:tcp *:* 7
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 0 [ ACC ] STREAM LISTENING 765 /dev/gpmctl
.....
So you want to say something like:
netstat -a | egrep LISTEN | egrep '*:ssh'
which gives:
tcp 0 0 *:ssh *:* LISTEN
when its listening.
(see, just like I said in a previous 'post' - netstat -a is your friend ;-)
rc
Rusty Carruth Email: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Voice: (480) 345-3621 SnailMail: Schlumberger ATE
FAX: (480) 345-8793 7855 S. River Parkway, Suite 116
Ham: N7IKQ @ 146.82+,pl 162.2 Tempe, AZ 85284-1825
ICBM: 33 20' 44"N 111 53' 47"W