帮助 |
树莓派 VSFTP + 花生壳 + IPTABLES
2014-10-12 21:55 内网穿透
1.安装VSFTP可以参考这篇文章 http://blog.csdn.net/c80486/article/details/8460854 2.配置VSFTP2.1配置文件nano /etc/vsftpd.conf 具体内容可以直接看后面的英文备注 目前已知可以多添加一些有用的内容: local_root=/home (添加本地用户的,可以使用相对路径) anon_root=/home/pi (添加匿名用户的默认登陆位置) userlist_enable=YES (使用拥有权限的用户list,但是默认是所有的本地账户都有权限,一般是NO好些) 2.2添加用户useradd -s /usr/sbin/nologin www passwd www 建议使用nologin 倘若使用nologin,会有登陆不了的问题 这是因为,VSFTP会查询 /etc/shells 的内容 需要将/usr/sbin/nologin 添加到 /etc/shells 中方可 root会无法登陆,原因出在/etc/pam.d/vsftpd当中 可以发现其中有一行 sense=deny file=/etc/ftpusers
cat /etc/ftpusers 中发现有root,于是登陆被deny了 将/etc/ftpusers 中的root删除即可 出现 500 OOPS: cannot change directory 是新建立的账户没有目录 3.动态DNS可以参考文章 http://panda.zjutv.com/index.php/rpi-ddns/ 4.iptables(待认证)路由器端 iptables -t nat -A PREROUTING -i eth0 --dport 20:90 -j DNAT --to 192.168.1.185 http://www.2cto.com/Article/201207/143938.html |