Add user group
groupadd sftp
Add users and set to SFTP group
sudo useradd -g sftp -s /sbin/nologin -M sftp
Modify the SFTP user’s password
sudo passwd sftp
***********
Create the root directory of the SFTP user and set the owner and group, modify the permissions (755)
cd /home
sudo mkdir sftp
sudo chown root:sftp sftp
sudo chmod 755 sftp
Create admin writable directory
in the directory of SFTP
cd sftp
sudo mkdir report
sudo chown admin:sftp report/
Modify the configuration file
sudo vim /etc/ssh/sshd_config
Modify the
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Add at the end of the sshd_config file
Match User sftp
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
ChrootDirectory /home/sftp
Restart the SSHD service
sudo service sshd restart
ftp client:
address : 192.168.1.10
user: sftp
password: xxxxxxx
protocol type : SSH2
port: 22
server folder: /home/sftp
pls use CuteFTP Pro® 8.3.3 or last version.
because CuteFTP Pro® 8.3.2 or earlier has no AES128 and AES256 ciphers.
will raise throw “SFTP21 error = #4” .
Read More:
- SFTP login error: fatal error: received unexpected end of file from SFTP server
- Vs_ Code remote SFTP connects to the server to modify the nginx configuration information and reports all configured authentication methods failed
- Could not publish server configuration for Tomcat v8.5 server at localhost
- Troubleshooting of samba error in Linux configuration startup
- ssh can connect but sftp can not connect
- Configuring NFS server in Linux
- Linux Tomcat accessing files on the server
- The Linux version of todesk cannot connect to the server
- Failure of spring boot configuration server port
- GConf Error: Failed to contact configuration server solution
- Vscode configuration connection server docker write code
- About Using SSH connection for Linux server
- Server configuration excel export HResult: 0x800A03EC
- How to clean up the disk space of Linux server
- Error in startup after the supervisor modifies the configuration file: error: cannot open an HTTP server: socket.error reported errno.eaddnotavail
- Configuration: error: no acceptable C compiler found in $path error in Linux installation file
- PHP under linux uses pdo-dblib to connect to mssql to report an error solution. Error message: SQLSTATE[01002] Adaptive Server connection failed (severity 9)
- Methods of exporting configuration and importing configuration in IntelliJ idea
- Configuration error in mybatis configuration file
- The server just without updating PID file and can’t connect to local MySQL server through socket are solved