Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm not an expert at any of this but, you could use the "userdel" command to remove the friends account. I have no idea why it shows that he is still logged in. But anyway, suppose your friends user name is "friend1" or something like that. You could type this:
userdel -r friend1
I believe the "-r" will cause the files in the user's home directory will be removed along with the home directory itself and the user's mail spool. You can look up more about the "userdel" command by typing this:
It sounds like you know how to tell if some one is logged in. One way to tell if someone is currently logged in is to type this:
where <username> is the login-username of the user you want to remove. if you have created a home directory, for example, too and want to remove it and all the files in it also when you remove the user, use
userdel -r <username>
instead. the -r switch means "remove user files too"...for more details, check
Another way to approach this problem is to use the "kill" command. If you can not log him out you may need to find his process ID number and use the "kill" command to kill the process. To find his process ID number you can use the "top" command and look for a proccess ID next to his name. You could type this:
Suppose that you find that his process ID number is 1792 or something like that (it will actually be a different number on your system). Then type this:
You might also want to look those commands up using the "man" command.
On my computer there are always dozens of processes listed under "top". There are always some processes running. Some of the processes are controlled by me and some by root. If the top command did not work you could look at all processes with this command instead:
I may have possibly been wrong when I suggested that you could use the "kill" command to log him out. B0uncer's suggestion to change the runlevel might be better. Perhaps using the "init" command did not work properly for some reason. You might need to manually edit the inittab file to change the run level. The inittab file is located in the /etc directory. I am not sure which distro you are using or which text editor you use. But, suppose you use "gedit", when you are logged in as root you could type this to edit the file:
Once the file is open you should see two lines that looks something like this:
# Default runlevel. (Do not set to 0 or 6)
The line with the "#" sign in front is just a comment. On the next line you need to change the 3 to a 1. You can then save the change and reboot. You should then be in single user mode. That sould do the same thing as what the "init 1" command should have done.
Was ssh already running by default when you installed Linux? Do you actually have any reason to have that running? For now at least you might want to shut down the sshd daemon that ssh uses. With most versions of Linux (but not Slackware) you could temporarily shut the sshd daemon down with this command:
That will only temporarily stop the sshd daemon and prevent using ssh and sftp for now. It will not keep it from automatically starting up when you reboot.