2016年3月20日 星期日

[Linux 文章收集] Howto: Linux Kill and Logout Users

Source From Here 
Introduction 
Yet another newbie question that suggests people love to kill and show their power to rest of the world ;). There is a package called procps. It includes various useful (nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as: 
* Halt user terminal
* Kill user and logout

The procps package contains utilities to browse the /proc filesystem, which is not a real file system but a way for the kernel to provide information about the status of entries in its process table. Procps includes ps, free, skill, pkill, pgrep, snice, tload, top, uptime, vmstat, w, watch and pdwx commands. 

How-To 

Task: How To Halt/Stop a User Called john 
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands. First, switch to the root user by typing su – and entering the root password, when prompted (you can also use sudo if configured). Type the skill command as follows: 
// -u, --euid euid,...: Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used.
# pkill -STOP -u john

The skill command sends a terminate command (or another specified signal) to a specified set of processes. 

Task: Resume Halted User Called john 
Send CONT single to user vivek, type the following command: 
# pkill -CONT -u john

To kill all php-cgi process owned by john user, enter: 
# pkill -KILL -u john php-cgi


Supplement 
How can I find out who is logged on my UNIX / Linux system?

沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...