FTP创建用户

创建一个账号为test的账户:

#mkdir /tmp/test                                    //首先创建好目录

#adduser -d /tmp/test  -g ftp -s /sbin/nologin test //-s/sbin/nologin是让其不能登陆系统,-d 是指定用户目录为/opt/srsman ,即该账户只能登陆ftp,却不能用做登陆系统用。

#passwd test

Changingpassword for user beinan.//接下来会出现让你设置新的密码

Newpassword:

Retypenew password:
passwd: all authentication tokens updated successfully

创建账户成功!

 

2、限制用户目录,不得改变目录到上级

修改/etc/vsftpd/vsftpd.conf
将这两行
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
注释去掉
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

新增一个文件: /etc/vsftpd/chroot_list
内容写需要限制的用户名:
test

重新启动vsftpd

# service vsftpd restart

 

摘自:。。??

 

posted @ 2011-08-29 11:30  Mr√liu  阅读(379)  评论(0)    收藏  举报