利用mysecureshell搭建sftp服务

1、下载对应的mysecureshell-1.33-1.x86_64.rpm包

2、安装mysecureshell-1.33-1.x86_64.rpm

3、添加ftp用户

     useradd ftp

4、配置/etc/passwd,将ftp的登录属性进行修改

ftp:x:1002:50::/home/ftp:/bin/MySecureShell

5、修改ssh配置 添加下列两行

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

AllowUsers     ftp

6、配置ftp用户目录

/etc/ssh/sftp_config 添加下列

<User ftp>
StayAtHome true
VirtualChroot true
DefaultRights 0777 0777 #Set default rights for new file and new directory
LimitConnection 10
LimitConnectionByUser 10
LimitConnectionByIP 10
Home     /home/ftp   为ftp目录
</User>

7、 启动sftp

sftp-state active

 

posted @ 2018-09-05 13:40  xiao_pai_pai  阅读(489)  评论(0编辑  收藏  举报