How to Configure Sftp Server in Linux




SFTP (Secure File Transfer Protocol) is a process that uses the file transfer protocol. Here I will discuss how to configure SFTP on Linux Ubuntu. SFTP configuration using the terminal.

The first to create a group for the user. For example sftponly
By way of entering the command below in your terminal
$ sudo groupadd sftponly

After that add the user into the group
$ sudo adduser pras sftponly

Install open-ssh, if not already installed please install by typing the following command:
$ sudo apt-get install openssh-server

After that you are setting the configuration by entering the following command:
$ sudo nano /etc/ssh/sshd_config



Then change his standard from:
Subsystem sftp /usr/lib/openssh/sftp-server

be like this

Subsystem sftp internal-sftp
Then at the bottom you add as follows:
Match group sftponly
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

To be available then you should type the following command:
$ sudo chown root.root /home/pras

Then to login as a user you can type this command:
$ sudo usermod -d / pras

not too hard, if you know how, hopefully useful


Next
Previous
Click here for Comments

0 comments: