You may have a case where you’ve added an FTP user to allow file transfer using vsftpd FTP server for example, but don’t want them to have access to SFTP/SSH.
To prevent users from logging into via SSH or SFTP, you can simply add their username to the SSH config file.
Open the SSH config in nano.
sudo nano /etc/ssh/sshd_config
Add the following to the bottom of the file replacing
user_name with the user you want to deny SSH and SFTP access. (To paste in nano, press the right mouse button).
Be very careful you don’t enter your root username here, or any username you use to access SSH or you could get locked out of SSH permanently.
To save file and exit, press
Y and then press
Restart the SSH service.
sudo service sshd restart
The user will now be denied access via SSH/SFTP but should still be able to log in to the FTP server to transfer files.
p.s. I increased my AdSense revenue by 68% using AI 🤖. Read my Ezoic review to find out how.