0

I am using CentOS server.

I wanted to test how to kick users by kicking myself (root) user.

I used killall -u root and it kicked me from the server which was as expected. However I am no longer able to access the server:

root@kali:~# ssh 383.123.418.10
ssh: connect to host 383.123.418.10 port 22: Connection refused

and all websites that were hosted on this server (cPanel and WHM) are down.

How do I fix this?

Kunok
  • 153
  • 6

4 Answers4

8

From the killall(1) man page

killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
...
-u, --user
Kill only processes the specified user owns. Command names are optional.

Your command

killall -u root

Will kill all (or at least many) processes running as root.

This is a fairly effective way to break the system

Solution

Restart the system. If you have access to a console and are able to log in you may be able to reboot. Depending on the type of system/hosting package you may have access to such things as a reset/power switch. A control panel,IPMI or other out of band management etc.

If none of the above are available then call your hosting provider and get them to reset it.

user9517
  • 115,471
  • 20
  • 215
  • 297
1

The command killall -u root is likely to have killed sshd. That's why you can't log in. I think it's a BOFH command

Go in the server room and press the reset button. It is likely to be in front of the server.

Once the server boots up, you are likely to be able to log in again.

bgtvfr
  • 1,262
  • 10
  • 20
1

From this state reboot is the only way. If your server has remote management card (ILO/DRAC/etc) you can do this remotely, otherwise just press reset.

user1700494
  • 1,642
  • 2
  • 12
  • 21
1

Reboot the server will also help if you have turned on ssh service on every reboot/restart with below command

chkconfig sshd on 

If you have not done this earlier and you server is lying on remote area, which is not physically accessible then just contact your hosting provider or data-center to restart the server manually and start sshd service for you.

After reading your question i remembered one of the quote by Frank Wilczek.

 "If you don’t make mistakes, you’re not working on hard enough problems." – Frank Wilczek

Hoping its not a big blunder made by you. Once sshd compes up you can verify all the services if they are not running just start them.

imvikasmunjal
  • 753
  • 7
  • 14