A few n00b BSD questions

Tha_Bomb

[H]ard|Gawd
Joined
Aug 15, 2000
Messages
1,283
Ok, I have 2 questions right now. I'm sure there's more, but I can't think of them at the moment. I'm using OpenBSD 3.6

1. how do I list all available interfaces like a "show ip int" command in Cisco language? :p

2. how do I get rid of "old" SSH sessions that were disconnected abormally? They are still running when I do a "top" command, but am I just supposed to use the kill command and hope I don't kill the one I'm using?
 
have you tried "kill ####" with whatever the pid is for the ssh sessions
 
that's what I have to do, but the problem is I can't tell if I'm about to kill the one I'm using or the one that's disconnected.

Thanks for the command. I kind of thought it might be some variation of ifconfig, but I couldn't determine which one. Thanks.

bah. What can I use that's like lspci and lsmod? I guess that's a linux-only thing.
 
scanpci and kldstat are most likely what you're after. (What does lspci do?)
 
Under FreeBSD there's pciconf -l(v) for showing what hangs off the PCI bus. I don't know if it's the same under OpenBSD...

Good luck with OpenBSD.
 
well, pids are created in sequence. So if you what order you opened them in, you can tell which one is which :). On Linux, the ps command also returns which console they're running in, which may help.
 
Besides, you can make sshd timeout sessions.
man sshd_config said:
ClientAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the client, sshd will send a message through
the encrypted channel to request a response from the client. The
default is 0, indicating that these messages will not be sent to
the client. This option applies to protocol version 2 only.

ClientAliveCountMax
Sets the number of client alive messages (see above) which may be
sent without sshd receiving any messages back from the client.
If this threshold is reached while client alive messages are
being sent, sshd will disconnect the client, terminating the ses-
sion. It is important to note that the use of client alive mes-
sages is very different from TCPKeepAlive (below). The client
alive messages are sent through the encrypted channel and there-
fore will not be spoofable. The TCP keepalive option enabled by
TCPKeepAlive is spoofable. The client alive mechanism is valu-
able when the client or server depend on knowing when a connec-
tion has become inactive.

The default value is 3. If ClientAliveInterval (above) is set to
15, and ClientAliveCountMax is left at the default, unresponsive
ssh clients will be disconnected after approximately 45 seconds.
Just add the above options to /etc/ssh/sshd_config .
 
Back
Top