Debian配置SFTP的chroot
2011-02-24Linux撒加15040°c
A+ A-网上N多关于chroot SFTP的,都TMD基于sshd_config的,我咋就没成功过呢,我RP不好???反思~~~~
其实有个好东西叫mysecureshell,这个东西做chroot SFTP是很简单的,还能限速等等。下面就说下在DEBIAN 6.0下怎么安装这个东西,当前版本都到1.25了
首先修改/etc/apt/sources.list,添加一行
deb https://mysecureshell.free.fr/repository/index.php/debian testing main
默认debian 6.0米有安装sudo,所以需要安装
apt-get install sudo
apt-get update
apt-get install mysecureshell
安装完后添加一个用户
adduser test
添加好后cat /etc/passwd,你会看到test:x:1001:1001:,,,:/home/test:/bin/bash
修改test:x:1001:1001:,,,:/home/test:/bin/bash为test:x:1001:1001:,,,:/home/test:/bin/MySecureShell
这样就修改好了。在adduser的时候可以指定用户的目录
对上传下载的控制可以修改/etc/ssh/sftp_config来实现