Â
Â
Hi techyv,
How will I disable sftp? My friend just make some move of enabling those file transfer protocol in my computer and when done making some secure transferring of files I would like to turn it off just for security purposes. I need a step by step instruction to turn it off properly.
Â
Hoping for your help. Thanks.
How will I disable sftp?
You might try this.
Place the user’s shell to:
/usr/libexec/openssh/sftp-server
This will give the right path for sftp-server, if it is on the server.
Do it by opening:
/etc/passwd and change the shell field to
/usr/libexec/openssh/sftp-server
Then it will look like this:
test:x:528:528::/home/test:/usr/libexec/openssh/sftp-server
next, add:
/usr/libexec/openssh/sftp-server to /etc/shells
This will disable sftp and shell access to user test.
How will I disable sftp?
Disabling SFTP is certainly a good security measure to prevent unauthorized intrusions to your system.Â
There are different ways to disable SFTP depending on your specific distro.Â
On UBUNTU, a simple way would be to simply comment out the following line in /etc/ssh :
# Subsystem sftp /usr/lib/openssh/sftp-serverÂ
After which, you should restart.
On CENTOS, you have to do the following:
1. Open the following file using any text editor:
# vi /etc/ssh/sshd_config
2. Comment out:
#Â Subsystem sftp /usr/lib/openssh/sftp-server
3. Save and restart your computer.
I hope this helps!