Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

UNIX

Posted on 2009-02-17
8
Medium Priority
?
456 Views
Last Modified: 2013-11-17
Hi,

I need to know if there is any unix command to disconnect the user connection from terminal!???
0
Comment
Question by:arefone
  • 4
  • 3
8 Comments
 
LVL 12

Expert Comment

by:TK-77
ID: 23659910
You could look up all processes from a user and then kill each one, one by one (i.e. user = bill):
ps - U bill
kill -9 {all processes listed by the previous command - enter one by one and enter)

You could use the kill command to kill all processes for a user:
kill -9 `ps -u bill | grep -v PID | awk '{ printf ("%s ", $1); }'`

This works in Linux and is much simpler, but I can't verify that it works in Unix:
# skill -CONT -u bill

TK
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 23659958
Hi,
what do you mean with 'disconnect'?
If you want to leave your processes running when terminating the shell,
you can use 'nohup' to protect them from 'hangup', '&' to put them in background and redirection to capture output, e.g.
nohup [my_long_running_job] >[logfile] 2>&1 &
Should there be an already running foreground job, put it in the background by pressing <CTL-Z> and then issuing 'bg'.
Prevent it from being terminated when you leave the shell by issuing
disown [job]
[job] is found by issuing 'jobs'
 
wmp
 
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 23659986
... sorry, I just saw it's AIX.
There is no 'disown' in AIX, use
nohup -p [pid]
instead.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:arefone
ID: 23660123
I mean, when the users are connected via appletalk, some times they connect with the same username from more computers, so, when I loggin via terminal I do the "w" command to see how many users are connected and from which computers, at this moment when I decide to disconnect, to end the session of one of them and to make him/her to connect again I don't know how to do, and every time I have to go to their computers and diconnect the connection by hand!
But, I remember that I used to use one command, I don't really remember it, it was somthing lik fuser -k KA3.0 or something else!!!!
Any help?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 23660345
Hi,
fuser -k kills all processes using a specific resource, such as a file or a tty.
Now I'm not familiar with appletalk.
If we knew whch resource to 'kill', this would do the trick.
Could you please post, as first steps,
1) the output of ps -ef | grep [userid], where [userid] is one of your appletalk users,
2) the output of procfiles -nF [pid], where [pid] is the process id from 1) (the second column)
I guess we'll have to terminate (with fuser -k) processes using some tty, or the like.
wmp
 
 
0
 
LVL 1

Author Comment

by:arefone
ID: 23660382
I agree, we have to terminate using some tty, so how I have to do the command for kill the user bellow?
francesc + KA13.0       Feb 17 10:12  0:55        2928  (192.168.100.89)
 
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 23660437
Well, that could be easy
fuser -k /dev/KA13.0
As I said, I don't know appletalk, but I guess KA13.0 is some sort of terminal entry in /dev.
Try it (but tell francesc first ...  )
 
wmp
 
0
 
LVL 1

Author Comment

by:arefone
ID: 23660606
It worked!
Thanx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question