SFTP 服务器配置

OpenSSH安装,版本要高于4.8sp1
openssl版本高于0.9.6

# tar zxvf openssh-5.4p1.tar.gz
# cd openssh-5.4p1
# ./configure  --with-ssl-dir=/usr/local/ssl   #openssl的安装位置
# make
# make install

配置文件:

/dicc/sftp_sshd/sshd_config

================
Protocol  2
Port 2122
SyslogFacility AUTHPRIV
PasswordAuthentication yes
ChallengeResponseAuthentication no
AllowTcpForwarding no
X11Forwarding yes
UseDNS no
ChrootDirectory /home/%u
Subsystem       sftp    internal-sftp
Match   group   sftp
ForceCommand    internal-sftp

======================

权限:

groupadd  sftp
chown root.sftp /home/sftp
useradd -d /home/sftp -s /bin/false -g sftp

启动:

/usr/local/sbin/sshd -f /dicc/sftp_sshd/sshd_config

PS:因为用了chroot,所以SFTP文件夹属主一定要是root,并且组权限不能写入,如果上传需要写入在/home/sftp/下建立可写属主的文件夹供上传使用

<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
阅读(1548) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-05 18:09:39

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com

评论热议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值