[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [suse-security] Close all ssh sessions

Option 1 works wonderfully ! 

Thank you all ;-)

Miguel Albuquerque
Network Administrator


Chemin de Trèfle-Blanc 18
1228 Plan-Les-Ouates / CH 

TEL : +41 22 827 30 80 
FAX : +41 22 827 30 33

- This message is intended for the use of the named person only. The 
information contained in this E-mail is confidential and any disclosure, 
copying, distribution or taking any action in reliance on the contents of 
this information is strictly prohibited. This message does not represent a 
formal commitment by Codalis SA. Codalis SA is neither liable for the 
proper and complete transmission of the information contained in this 
communication nor for any delay in its receipt.

Polarizer <Polarizer@xxxxxxxxxx> 
24.11.2005 17:13


Re: [suse-security] Close all ssh sessions

Miguel ALBUQUERQUE schrieb:
> Hi,
> How can one force closing an open ssh session ? I want to disconnect a 
> user right after executing a script no waiting for a timeout. Is that 
> possible ?

I've 3 ideas


What about to replace the login shell in /etc/passwd with the script
the user can invoke. If script is done user gets logged out :O)_



One can invoke a script via

ssh a.ip.addr.ess "command"

so if you can disable interactive sessions in sshd it will fulfill your
requirements (Dunno how to accomplish that ad hoc)


man bash

PPID   The process ID of the shell's parent.  This variable is readonly.

If one invokes a script this variable should contain the PID of the 
underlying bash. Just kill -9 $PPID in the of the script.

Hope that helps

the polarizer

Check the headers for your unsubscription address
For additional commands, e-mail: suse-security-help@xxxxxxxx
Security-related bug reports go to security@xxxxxxx, not here