Linux setup SFTP

Source: Internet
Author: User

SFTP installation

SFTP implements file transfer, but cannot log on to the system


1.SFTP More secure

Only under your own home directory



Groupadd SFTP

Useradd-g sftp-s/sbin/nologin-d/sftp/wuang (that is, the folder as the user's home directory) Wuang


passwd Wuang



Modify Sshd_config


Found it

Subsystem Sftp/usr/libexec/openssh/sftp-server

Comment out


Add to

Subsystem sftp internal-sftp

Match Group SFTP

#Match User Wuang

#ChrootDirectory/sftp/wuang


Chrootdirectory/sftp/%u

Forcecommand internal-sftp

Allowtcpforwarding No

X11forwarding No


There are two key points to setting permissions for a directory:

1. The directory owner that is specified by Chrootdirectory to start all the way up to the root of the system can only be root

2, the directory specified by chrootdirectory starts to go up to the system root directory can not have group write permission



/SFTP 755 can be

Also need to be built under/sftp/wuang


Folders that can be uploaded

Mkdir/sftp/wuang/upload


Chown Root:root/sftp/wuang

Chown Wuang:sftp/sftp/wuang/upload

chmod 755/sftp/wuang/upload



SELinux needs to be closed


This article is from the "Don't Ang" blog, please be sure to keep this source http://wuang.blog.51cto.com/9559762/1606198

Linux setup SFTP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.