+91 77362 71566 [email protected]

How do I remove SSH access

Depending on how you login to root…if you logged in with a key file you would have to switch to a different key file by generating a new one and replacing the old one in the authorized keys…

If you did not use keys files and used a password…sadly you would have to reset the password…there is not a workaround since he knows the password and the username for ssh…what are you going to do? Make him forget it?

You shouldn’t be using the root account anyway in case you execute the wrong there is no going back…

What you could do is make another user account with sudo privilege’s using the same password just different name and disable root login…

       How do I migrate WordPress site from shared hosting to Digital Ocean?

If you gave the developer root access, you’ll need to change the root password or upload a new authorized key list.

If you gave the developer a separate user account, you can lock it with:

  • /usr/bin/passwd developer_user -l 

Or, delete it:

  • /usr/sbin/userdel developer_user 

That should do it.

If he is having an SSH access as a different user, then you can remove the user from users list. That way you can deny his access. If you login to digital ocean server with say [email protected], then you need disable or remove user Ubuntu and create a new user and add him to sudo users.

From security is always better to change root password when an employee leaves. Root user can compromise your all year’s work.

The “internet” doesn’t really know what qualifies as you. So, you need to tell it.

  • You could set up an IP address limitation for port 22 (the default SSH port). Look into iptables for that.
  • If, more likely, you are looking for a way to disable SSH access for certain users on your server, look into this guide, particularly the section titled “Limiting the Users Who can Connect Through SSH”.
Share This

Share This

Share this post with your friends!