zoukankan      html  css  js  c++  java
  • linux下ftp(vsftpd)添加用户及设置权限详细步骤

    1、环境:ftp为vsftp。被限制用户名为test。被限制路径为/home/test
    2、建用户:在root用户下:
    useradd test //增加用户test,并制定test用户的主目录为/home/test
    passwd test //为test设置密码
    3、更改用户相应的权限设置:
    usermod -s /sbin/nologin test //限定用户test不能telnet,只能ftp
    usermod -s /sbin/bash test //用户test恢复正常
    usermod -d /test test //更改用户test的主目录为/test
    4、限制用户只能访问/home/test,不能访问其他路径
    修改/etc/vsftpd/vsftpd.conf如下:
    chroot_list_enable=YES //限制访问自身目录
    # (default follows)
    chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
    编辑 vsftpd.chroot_list文件,将受限制的用户添加进去,每个用户名一行
    改完配置文件,不要忘记重启vsFTPd服务器
    [root@linuxsir001 root]# /etc/init.d/vsftpd restart 或 service vsftpd status
    5、如果需要允许用户修改密码,但是又没有telnet登录系统的权限:
    usermod -s /usr/bin/passwd test //用户telnet后将直接进入改密界面

    6.别忘记更改文件夹的权限,否则会服务器上传下载文件额。

    例如:chmod 777 filename 最高权限,当然你也可以改755 等

  • 相关阅读:
    leetcode[9]Palindrome Number
    leetcode[10]Regular Expression Matching
    leetcode[11]Container With Most Water
    leetcode[12]Integer to Roman
    leetcode[13]Roman to Integer
    leetcode[14]Longest Common Prefix
    leetcode[15]3Sum
    leetcode[16]3Sum Closest
    leetcode[17]Letter Combinations of a Phone Number
    leetcode[18]4Sum
  • 原文地址:https://www.cnblogs.com/hshanghai/p/3259836.html
Copyright © 2011-2022 走看看