Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install sftp server for linux

2025-02-24 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report