简体   繁体   中英

How to auto end/destroy an existing connected putty session (any telnet or ssh) for a user, if permission has been modified

如果“ root”更改了该用户不访问任何cmd的权限,如何为该用户自动结束/销毁现有的已连接腻子会话(任何telnet或ssh)?

I'm not clear of the situation. Are you asking how a sys admin could kill existing connections?

ps -fu joebob | awk '{print $2}' | xargs kill -9

or you could restrict it to only processes with a controlling terminal with a little bit of more programming (and not kill joebob's process that are in the background).

Or is this from the perspective of the uesr himself? exit is an internal shell command that will terminate the shell. Most shells also have an auto log out feature where it logs out after so many seconds of inactivity.

So far, it seems too contrived of a situation. What are you really trying to do?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM