How to Revoke a Former Developer's Access to Your Server

22 Nov 2026, 06:19:10
If you have provided a developer with full or partial access to your server and your cooperation has ended, change all passwords, keys, and other authentication credentials that may have been accessible to them.
Changing the root password alone is not enough. The developer may have created additional users, added SSH keys, FTP accounts, database, CMS, and control panel accounts, configured scheduled tasks, or set up automatic connections through third-party services.
Therefore, audit access and update all credentials one by one. Run the commands below as root (or using sudo) and, where possible, follow the order of the sections: first close the most dangerous access paths, then check everything else.

1. Preparation

Before making changes:
  • back up website files, databases, and configuration files;
  • open a second SSH session (or your hosting provider's console/VNC) in case a configuration error locks you out;
  • check who is currently connected to the server:
w
who
Changing a password does not terminate sessions that are already open. If you see a suspicious session, lock the account first, then terminate its processes:
pkill -KILL -u username

2. Changing the root password

If the developer had root access, change the superuser password:
passwd rootSet a unique, strong password that has not been used anywhere else. On our VPS servers, you can change the root user's password by clicking the Reset Password button on the service page.
Changing the password does not disable SSH key access or change the passwords of other users, so check the remaining authentication methods as well.

3. Checking SSH keys and SSH settings

Key-based authentication does not depend on the password. Check the root keys:
cat /root/.ssh/authorized_keysRemove any keys you do not recognize or that were added by the developer. Pay attention to lines containing options such as command=: they can execute arbitrary commands when the user logs in.
Check the keys of all users. Searching only in /home is not sufficient: a home directory may be located in /var/www, /opt, or elsewhere. It is more reliable to check the directories listed in /etc/passwd:
getent passwd | cut -d: -f6 | sort -u | while read -r h; do if [ -f "$h/.ssh/authorized_keys" ]; then echo "===== $h/.ssh/authorized_keys"; cat "$h/.ssh/authorized_keys"; fi; doneReview the effective SSH server configuration, including all included files:
sshd -T | grep -Ei 'permitrootlogin|passwordauthentication|allowusers|allowgroups|authorizedkeysfile|trustedusercakeys'
ls -la /etc/ssh/sshd_config.d/
Pay attention to the following:
  • AuthorizedKeysFile — keys may be stored in a non-standard location; check these files as well;
  • TrustedUserCAKeys — a trusted certificate authority allows users to log in using certificates issued by it, without entries in authorized_keys;
  • AllowUsers / AllowGroups — specifies who is allowed to log in;
  • settings in /etc/ssh/sshd_config and in the files /etc/ssh/sshd_config.d/*.conf.
Once you have confirmed that your key works, it is recommended to disable password authentication and root password login:
PermitRootLogin prohibit-password
PasswordAuthentication no
After changing the configuration, check it and apply the changes:
sshd -t && systemctl reload sshdOn Debian and Ubuntu, the service may be called ssh:
systemctl reload ssh. The reload command does not terminate existing sessions.
Important: do not close your current session until you have tested logging in through the second one. Otherwise, a configuration error could result in losing access to the server. Our hosting service provides the option to connect to a VPS through the VNC console (Remote Console), even if SSH access has been lost or is unavailable.
To connect, go to the relevant service page in the control panel and click Remote Console. A console will then open, allowing you to manage the server directly without using SSH.

4. Checking Linux system users

The developer may have created separate accounts for working with the server, running scripts, or managing applications.
List the users:
cat /etc/passwdUsers with a working command shell (shell, other than nologin or false):
awk -F: '$7 !~ /nologin|false/ {print $1, $7}' /etc/passwdUsers with UID 0 (there should be none other than root):
awk -F: '$3 == 0 {print $1}' /etc/passwdCheck who has superuser privileges. These privileges may be granted through entries in sudoers or group membership:
grep -R -E '^[^#].*ALL=' /etc/sudoers /etc/sudoers.d/ 2>/dev/null
getent group sudo wheel admin docker lxd
Members of the docker and lxd groups can effectively obtain root access as well, so check them as carefully as you check sudo.
First lock an unnecessary account and terminate its processes:
usermod -L -s /usr/sbin/nologin username
pkill -KILL -u username
After that, once you have confirmed that the home directory contains no files you need, you can delete the user:
userdel -r usernameReplace username with the user's name.
Warning:userdel -r deletes the user along with their home directory. Before deleting the account, make sure it does not contain important files, websites, scripts, or data. If the user still has running processes, the command may fail.

5. Changing FTP/SFTP access credentials

If the developer was given FTP or SFTP access, check all created accounts and change their passwords.
Depending on the configuration, users may be stored in Linux system accounts, in a database, or in the hosting control panel.
Check the running FTP services:
systemctl list-units --type=service --all | grep -Ei 'ftp|vsftpd|proftpd|pure-ftpd'If the FTP user is a Linux system user, change their password:
passwd usernameIf access accounts were created through a control panel (Plesk, ISPmanager, etc.), change the passwords or delete unnecessary accounts directly in that panel.
Make sure there are no unnecessary FTP/SFTP users with access to website directories. SFTP runs over SSH, so the keys belonging to these users must also be checked as described in Section 3.

6. Changing access credentials for websites and web applications

In addition to access to the server itself, the developer may have had separate accounts for managing websites and applications. These are not linked to the root password, so check them separately.

CMS administrative panels

If the server uses WordPress, Joomla, Drupal, OpenCart, or another CMS:
  • check the list of users in the administrative panel and make sure there are no unknown administrators;
  • change the passwords of accounts the developer had access to and delete their accounts if they are no longer needed;
  • check the roles and permissions of other users;
  • check installed plugins, modules, extensions, and themes: the developer may have added or modified them;
  • terminate other users' active sessions.
Changing the server password does not revoke the developer's access to the CMS, so check the accounts for each website separately.

Checking website files for backdoors

A new administrator account may be noticeable in the admin panel, but a web shell (a script that provides remote control through a browser) can be hidden in the files. Here is what you should check:
find /var/www -type f -name '*.php' -mtime -90
grep -RIl --include=*.php -E 'eval.base64_decode|gzinflate.base64_decode|shell_exec|passthru' /var/www
The first command displays PHP files modified within the last 90 days; the second searches for common indicators of malicious code. Matches do not always indicate a compromise: some legitimate plugins use the same functions, so review each result. Also check upload directories (for example, wp-content/uploads): there should be no PHP files there.

Server and website control panels

If Plesk, ISPmanager, FastPanel, HestiaCP, or another control panel is installed:
  • change the passwords for accounts the developer had access to;
  • delete unnecessary accounts and check user permissions;
  • make sure no additional administrators have been created;
  • check access to phpMyAdmin and other management tools.
A developer with administrative privileges in the control panel may have created websites, users, databases, and other accounts independently of SSH access.

7. Changing database passwords

The developer may have had access to databases, as well as to the credentials websites use to connect to them. Check all DBMSs installed on the server: MySQL/MariaDB, PostgreSQL, Redis, MongoDB, and others.

MySQL / MariaDB

Run the following in the console (mysql -u root -p). List users and the hosts they are allowed to connect from:
SELECT User, Host FROM mysql.user;Pay attention to users with Host = '%': they can connect remotely. To view a specific user's privileges:
SHOW GRANTS FOR 'dbuser'@'localhost';Change the password:
ALTER USER 'dbuser'@'localhost' IDENTIFIED BY 'NEW_STRONG_PASSWORD';Replace dbuser with the database username and NEW_STRONG_PASSWORD with the new password. The FLUSH PRIVILEGES command is not required after ALTER USER.
Delete or restrict unknown users and users with excessive privileges.

PostgreSQL

sudo -u postgres psql -c '\du'
sudo -u postgres psql -c "ALTER USER dbuser WITH PASSWORD 'NEW_STRONG_PASSWORD';"
Also check pg_hba.conf (which hosts and authentication methods are allowed) and listen_addresses in postgresql.conf.

Updating application configurations

After changing a password, update it in the website configuration files; otherwise, applications will not be able to connect to the database. Depending on the application, credentials may be stored in the following files:
  • wp-config.php — WordPress;
  • configuration.php — Joomla;
  • config.php — various CMSs and applications;
  • .env — applications that use environment variables.

8. Checking third-party services and integrations

The developer may have gained access not only to the server but also to services used by websites and applications. Check and, if necessary, change access to:
  • your hosting provider or VPS provider account: it can be used to open the console, enter recovery mode, or reinstall the server;
  • email and SMTP passwords;
  • API keys and access tokens;
  • Cloudflare and DNS access;
  • your domain registrar account;
  • GitHub, GitLab, and other repositories, including deploy keys, webhooks, and CI/CD secrets;
  • backup services and keys for backup storage;
  • private SSL certificate keys (if you suspect they have been compromised, reissue the certificates);
  • external APIs and integrations (payment systems, SMS, analytics, etc.);
  • access credentials for other servers and hosting accounts;
  • OAuth tokens and connected applications.
Where possible, enable two-factor authentication everywhere it is supported.
If the developer had access to repositories containing configuration files, check whether they contain passwords, API keys, or other secrets. Remember that a secret once added to a repository's history remains there even if the file is deleted, so it must be considered compromised.
Do not simply delete compromised or unknown keys: generate new ones and update the configurations of all services that use them.

9. Checking cron and scheduled tasks

The developer may have configured scheduled tasks that run scripts as a user or as root.
List the cron jobs for all users (including root):
for user in $(cut -f1 -d: /etc/passwd); do
echo "===== $user ====="
crontab -u "$user" -l 2>/dev/null
done
System tasks:
cat /etc/crontab
ls -la /etc/cron.d/ /etc/cron.hourly/ /etc/cron.daily/ /etc/cron.weekly/ /etc/cron.monthly/
ls -la /var/spool/cron/ /var/spool/cron/crontabs/ 2>/dev/null
atq
systemd services and timers:
systemctl list-unit-files --type=service
systemctl list-timers --all
Autostart mechanisms can also be hidden in other locations. Check:
  • /etc/rc.local;
  • /etc/profile.d/ and /etc/profile;
  • .bashrc, .profile, and .bash_profile in the root and users' home directories;
  • custom unit files in /etc/systemd/system/.
If you find unknown scripts, tasks, or services, first determine what they are used for, and only then disable or delete them.

10. Checking additional access methods

After changing passwords and checking user accounts, perform an additional server audit.
Running processes:
ps auxfOpen ports and services accepting connections:
ss -tulpnActive outgoing connections (these can reveal reverse tunnels and remote shells):
ss -tnp state establishedFirewall rules and recent logins:
iptables -S
nft list ruleset
last -a | head -n 30
Pay attention to unknown processes, services, scripts, and applications, as well as additional remote access methods (VPNs, tunnels, proxies, and remote desktops).
Remember: a user with root privileges can clean logs, command history, and the output of last. Clean logs do not prove that the server has not been tampered with.
If the developer had full root access, you cannot rule out the possibility that they changed the system configuration, installed additional software, or created hidden access mechanisms. If you suspect a compromise, consider reinstalling the operating system.

11. Reinstalling the operating system

If the developer had full root access and you are not sure what changes they made, the most reliable option is to reinstall the OS. This gives you a clean system without unknown accounts, services, scripts, or other traces left by the previous administrator.
Before reinstalling, save important data: website files, databases, email, configuration files, and any other required materials.
When restoring the server, transfer only verified data and settings; do not copy the entire old server configuration without a specific need. Keep in mind that a backdoor may also be present in the data itself: in website files, scripts, plugins, or the database (for example, a hidden CMS administrator account). Therefore, make sure to actually verify the files you restore: compare them with the repository or a clean CMS version, and review the list of users in the database.
After reinstalling:
  • use new SSH keys and new server host keys;
  • reissue SSL certificates;
  • configure key-based login, a firewall, and automatic updates immediately;
  • change the passwords for all services whose credentials were stored on the old server.

Conclusion

If you gave a developer access to your server, especially root access, do not limit yourself to changing a single password. Check all possible access methods: active sessions, user accounts, SSH keys, FTP/SFTP, databases, CMSs, control panels, third-party services, and scheduled tasks.
If you are not confident that the server is secure, the most reliable solution is to reinstall the operating system and then restore only verified data.

VPS in the Netherlands

Browse Configurations

Premium Dedicated Servers

Browse Configurations