zoukankan      html  css  js  c++  java
  • Linux创建新用户,给予FTP操作权限

    1.安装FTP

    yum -y install vsftpd

    2.新建用户,并指定主目录

    useradd -d /home/test -m test  (增加用户test,并制定test用户的主目录为/home/test)

    3.设置新用户密码

    passwd test          (为test设置密码)

    4.更改用户相应的权限设置

    usermod -s /sbin/nologin test   (限定用户test不能telnet,只能ftp)
    usermod -s /sbin/bash test    (用户test恢复正常)
    usermod -d /test test        (更改用户test的主目录为/test)
     
    5.限制用户只能访问/home/test,不能访问其他路径
     
    修改/etc/vsftpd/vsftpd.conf如下: 
    chroot_list_enable=YES //限制访问自身目录
    # (default follows)
    chroot_list_file=/etc/vsftpd/chroot_list
    编辑 chroot_list文件,将受限制的用户添加进去,每个用户名一行
    改完配置文件,不要忘记重启vsFTPd服务器
    [root@linuxsir001 root]# /etc/init.d/vsftpd restart
  • 相关阅读:
    leetcode643.滑动窗口例题
    BZOJ4195 离散化+并查集
    luogu线性表刷题
    2021-5-29 周报博客
    2021-5-28 日报博客
    2021-5-27 日报博客
    2021-5-26 日报博客
    2021-5-25 日报博客
    2021-5-24 日报博客
    梦断代码阅读笔记之二
  • 原文地址:https://www.cnblogs.com/daxuan/p/7692479.html
Copyright © 2011-2022 走看看