Products
GG网络技术分享 2025-11-12 17:51 3
根据您给的文章内容,
创建SFTP用户组

sftp的用户组。设置用户权限
sftp用户组。/data/sftp下按用户名区分那个。修改sshd_config配置文件
sshd_config文件。sshd_config中修改相关配置,比方说指定ChrootDirectory到用户的home目录。设置密钥对
免密登录
上传文件
bash
put /path/to/local/file /path/to/remote/directory/
下载文件
bash
get /path/to/remote/file /path/to/local/directory/
列出远程目录内容
bash
ls /path/to/remote/directory/
指定端口登录SFTP服务器
bash
sftp -oPort=port_number username@host
其中, port_number是SFTP服务器用的端口号,username是登录用户名,host是SFTP服务器的主机名或IP地址。
sshd_config中设置正确的ChrootDirectoryNeng别让用户逃出其home目录。通过上述步骤和命令,Neng在CentOS 7上成功配置和用SFTP服务进行平安的文件传输。
Demand feedback