[SOLVED] pkill -KILL -u root ...... is that bad???
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was remoted into the server last night and was using new commands to test them out, and used the pkill command to log out all users, including root. I did this because I forgot to logout of root on my server and wanted to do it remotely (the server has no monitor hooked to it at the moment, and is plugged in somewhere else)
Since I had two root users logged in and wanted to log out the server's login and remote root user, I used the following command:
# pkill -KILL -u root
My terminal session using the ssh was immediately closed, and I went to bed.
Woke up today, and could not FTP in via FileZilla. Could not remote in like I have been via Putty (but it worked yesterday), and the sites are again loading VERY, VERY slow if at all. When I do a tracert externally from the LAN, the requests time out (im guessing on my end). I cannot even ping my server from inside the LAN, ssh from the LAN or externally.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well you could just hit the reset button on the machine if you have physical access
edit
just tried that little stunt on a machine i was in front of and the results were NOT pretty
essentially you just killed everything running on your machine, gettys, your login manager, sshd, probably your network stack.. EVERYTHING maybe even the kernel so the only way to fix that is a physical reboot button
My BIOS was halting when no KB was attached,..... duh
So the issue I created at first was killing all the users, and somehow crippled my server for any logins via ssh. I dont really know how that is possible, but ill accept that as the answer.
When I rebooted the machine, it didn't come back up because of no KB attached. After I attached it and rebooted, now I can remote in, FTP in etc.
Even though I learn things the hard way, it sure is a good way to remember them!
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
as i was saying earlier
most of the daemons (ftpd, sshd, even the master process init) run as root, so killing everything running as user root effectively kills the system entirely, basically you effectively crashed your server by doing that
trust me i've done worse
eg, rm -f /etc/rc.d and /etc/init.d as root
On another funny note, I did something like that to my macbook pro one day. I was having some MySQL issues with the RoR app I was developing, and wanted to reinstall it. I was following a guide, and forgot to enter the directory in the library folder, so I deleted my entire library >.<
Needless to say, all my icons in the dock changed to "?"s, and I had to reinstall OSX from scratch.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.