zoukankan      html  css  js  c++  java
  • Linux vfpd锁定用户目录

    在linux ftp配置中,为了防止用户cd 到其他目录,需要锁定用户的根目录。

    Step1:修改配置文件

    [root@ess ~]# vi /etc/vsftpd/vsftpd.conf 

    #chroot_local_user=YES
    chroot_list_enable=YES                           //取消该行注释
    # (default follows)
    chroot_list_file=/etc/vsftpd/chroot_list     //取消该行注释,并且创建/etc/vsftpd/chroot_list

    allow_writeable_chroot=YES                 //加入该行

    Step2:将需要锁定目录的用户加入列表

    [root@ess ~]# vi /etc/vsftpd/chroot_list

    tom

    Step3:重启vsftpd服务

    [root@ess ~]# systemctl restart vsftpd.service

    Step4:测试

    C:>ftp 192.168.1.10
    连接到 192.168.1.10。
    220 (vsFTPd 3.0.2)
    用户(192.168.1.10:(none)): tom
    331 Please specify the password.
    密码:
    230 Login successful.
    ftp> dir
    200 PORT command successful. Consider using PASV.
    150 Here comes the directory listing.
    drwxrwxr-x 3 1000 1000 3 Jan 31 02:49 2019
    drwxr-xr-x 2 1000 1000 2 Jan 31 03:02 perl5
    226 Directory send OK.
    ftp: 收到 128 字节,用时 0.00秒 128.00千字节/秒。
    ftp> cd /
    250 Directory successfully changed.
    ftp> pwd
    257 "/"

  • 相关阅读:
    android(eclipse)界面控件以及活动总结(二)
    android(eclipse)新手常见问题总结(一)
    易 忽略 知识 点
    switfmailer 邮件时间错误 处理
    error_log
    $_SERVER['URI']
    apache 服务器配置
    sock
    __autolaod
    delete CDU
  • 原文地址:https://www.cnblogs.com/networking/p/10341215.html
Copyright © 2011-2022 走看看