In Unix, how do I kill another login session remotely?

You can kill a Unix/Linux login session remotely by sending a hangup signal (SIGHUP) to the process running the login session. To do this, follow the steps below:

  1. Identify the shell you want to kill. To determine your current tty, from your Unix shell prompt, enter:

     

     

     

  2. To show all of your running processes, enter:

     

     

     

    Replace username with your username.

  3. You should see something like this:

     

     

     

    In the first column, "PID" stands for "process ID". The second column shows the tty to which your processes are connected. The dash (-) before a process name shows that the process is a login shell.

  4. To remove the remote shell, look for the processes with a dash and choose the process number that is not for your current tty. Then issue the following command:

     

     

     

    Replace processid with the process ID number you identified.

When you send a SIGHUP (by entering kill -HUP or kill -1) to a login shell, all the processes that were started in the shell will be killed as well (unless they were in the background). SIGHUP is good because it allows applications like Elm and Emacs to exit gracefully, leaving your files intact.


faltutech

Pursuing MCA from YMCA University, Faridabad

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
Showcase your music or Just use it for personal online music stream(PHP Script)

Script Updated On - 10 May, 2017 Here we are presenting a small PHP script to make your own personal...

Close