PDA

View Full Version : How to create an SFTP Server using Linux CentOS?



ORLOVA
11-07-2020, 04:53 AM
Hello folks,

How to create an SFTP Server using Linux CentOS?

lishmalinyjames
11-18-2020, 11:24 AM
Step 1: Create a dedicated sFTP group and a dedicated sFTP user. groupadd sftpusers useradd -g sftpusers -s /sbin/nologin user1 passwd user1.
Step 2: Modify the configuration of the sshd service.
Step 3: Create a dedicated directory for the sFTP-only user.
Step 4: Create more sFTP-only users.

techinfo
02-09-2021, 12:20 PM
Step 1. Create a new group named sftp_fosslinux as following:
sudo addgroup sftp_fosslinux

Step 2. Create a new user named “sftpfossuser” and add it to the previously created group.
sudo useradd -m sftpfossuser -g sftp_fosslinux

Step 3. Add a password to the new SFTP user.
sudo passwd sftpfossuser

Step 4. Now, grant the new SFTP user complete access to their new home directory as follows:
sudo chmod 700 /home/sftpfossuser/
you need to install ssh for sftp
sudo apt install ssh

sudo vi /etc/ssh/sshd_config

Match group sftp_fosslinux
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

sudo systemctl restart ssh
login to sftp

sftp sftpfossuser@ipaddress