部署sftp服务器

groupadd stfpusers
adduser ftp01 -G stfpusers
adduser ftp02 -G stfpusers
echo “ftp01:redhat123” | sudo chpasswd
echo “ftp02:redhat123” | sudo chpasswd

mkdir -p /sftp/ftp01/home
mkdir -p /sftp/ftp02/home

chown -R ftp01:ftp01 /stfp/ftp01
chown -R ftp02:ftp02 /sftp/ftp02
chmod -R 770 /sftp/ftp01
chmod -R 770 /sftp/ftp02
mkdir -p /sftp/team
mkdir -p /sftp/pub
chown root:sftpusers /sftp/team
chmod 2770 /sftp/team
find /sftp -user ftp01 -print0 | xargs 0 -I {} ls -ld {}

chmod 1777 /sftp /pub

[root@iZbp1cr1sgiqi6r6qlygx9Z java]# ls -l /sftp
total 16
drwxr-xr-x 3 ftp01 ftp01 4096 Jul 14 14:26 ftp01
drwxr-xr-x 3 ftp02 ftp02 4096 Jul 14 14:26 ftp02
drwxrwxrwt 2 root root 4096 Jul 14 15:30 pub
drwxrws— 2 root root 4096 Jul 14 15:30 team

vim /etc/ssh/sshd_config
注释

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

Subsystem sftp internal-sftp -d u%/home
service sshd restart
sftp ftp01@ip
cd ../../
sftp ftp02@ip

[root@iZbp1cr1sgiqi6r6qlygx9Z java]# sftp ftp01@47.97.7.166
The authenticity of host ‘47.97.7.166 (47.97.7.166)’ can’t be established.
ECDSA key fingerprint is SHA256:hSULVTFCm+bLtXuU3EXBXjFBgmJetKU2q2DPtNXR5os.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘47.97.7.166’ (ECDSA) to the list of known hosts.
ftp01@47.97.7.166’s password:
Consftp> pwd
Remote working directory: /home/ftp01
nected to 47.97.7.166.
sftp> cd ../../
sftp> pwd
Remote working directory: /

图片[1]-部署sftp服务器-晴天生活分享日志
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容