In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Linux how to install sftp server, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Sftp uses ssh encrypted tunnel, which is a data flow connection and a network transport protocol that provides file access, transfer and management functions. It is more installable than ftp and relies on the ssh service that comes with the system.
1. Create a sftp group
# groupadd sftp
Information about using the cat / etc/group command group after creation
two。 Create a sftp user mysftp and join the created sftp group, while changing the password of the mysftp user
# useradd-g sftp-s / bin/false mysftp
# passwd mysftp
3. Create a new / data/sftp/mysftp directory and specify it as the home directory for the mysftp group user
# mkdir-p / data/sftp/mysftp
# usermod-d / data/sftp/mysftp mysftp
4. Edit the configuration file / etc/ssh/sshd_config,vi / etc/ssh/sshd_config
Comment out the following line with the # symbol
# Subsystem sftp / usr/libexec/openssh/sftp-server
And add the following lines at the end of the file and then save
Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory / data/sftp/%u
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
5. Set Chroot directory permissions
# chown root:sftp / data/sftp/mysftp
# chmod 755 / data/sftp/mys
6. Create a new directory for stp user mysftp to upload files. The owner of this directory is mysftp, all groups are sftp, and the owner has write permission. All groups have no write permission.
# mkdir / data/sftp/mysftp/upload
# chown mysftp:sftp / data/sftp/mysftp/upload
# chmod 755 / data/sftp/mysftp/upload
7. Shut down selinux and restart the sshd service, and then test
8. Verify on another server, sftp user name @ ip address
The sftp installation is complete.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.