Sftp

来自linuxsa wiki
Evan留言 | 贡献2026年5月23日 (六) 15:44的版本 sft
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到导航 跳转到搜索

sft

#May 2026

 sftp [email protected]
Connected to 1.1.1.1.
sftp> get /root/sftpfile.txt 
Fetching /root/sftpfile.txt to sftpfile.txt
sftpfile.txt                     100%   13     0.0KB/s   00:00    
sftp> 
下载 远程 服务器上的 /root/sftpfile.txt 到本地当前目录

#upload  local :Take the file named remotefile.txt from my local /tmp directory, upload it to the remote server, and save it there as /data/remotefile_copy.txt.
put /tmp/remotefile.txt /data/remotefile_copy.txt





#  过年前还有个笔记的 不知放哪去了呢 
 group sftp 
groupadd  sftp 
useradd  -g sftp -d /data/sftp/habz -s /bin/false habz
passwd  habz
chown root:sftp /data/sftp/habz/
chmod 755  /data/sftp/habz/
mkdir  /data/sftp/habz/upload
chown habz:sftp /data/sftp/habz/upload
chmod 755 /data/sftp/habz/upload



vi /etc/ssh/sshd_config
#evan 要放最后面 切记
#Subsystem sftp	/usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Match Group sftp                          
#Match User ftpuser                          
ChrootDirectory /data/sftp/%u                   
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
#evan




普通创建  再 
usermod  -a -G root youuser

Reference

eference

同一台 Centos (Linux)服务器设置多个sftp 账号,并限制用户只能访问指定文件路径 原创

搭建sftp服务器并限制用户


Sftp只允许用户访问指定的目录

SFTP多账户

sftp服务——linux创建两个账户,对同一个文件夹具有不同的权限

Linux多用户共同使用同一目录

linux如何让普通用户访问其他用户目录

Linux设置某个目录允许多用户读写,Give write permissions to multiple users on a folder in Ubuntu

linux查询目录归属用户,修改Linux系统的文件目录, 所有者,以及用户组


sftp多用户不同权限配置过程