zoukankan      html  css  js  c++  java
  • linux中系统用户禁用shell访问,只允许ftp访问的配置

    默认情况下,在创建用户时,如果未明确指定,该用户将具有对服务器的 SSH 访问权限。

    要禁用 shell 访问,我们将创建一个新的 shell,它会简单地打印一条消息,告诉用户他们的帐户仅限于 FTP 访问。

    1 运行以下命令以创建 /bin/ftponly shell 并使其可执行

    echo -e '#!/bin/sh
    echo "This account is limited to FTP access only."' | sudo tee -a  /bin/ftponly
    sudo chmod a+x /bin/ftponly

    2 将新 shell 附加到 /etc/shells 文件中的有效 shell 列表中

    echo "/bin/ftponly" | sudo tee -a /etc/shells

    3 将用户 shell 更改为 /bin/ftponly

    sudo usermod newftpuser -s /bin/ftponly
  • 相关阅读:
    一位年轻女董事长的忠告:不想穷下去就请看
    Ajax拓展02
    Ajax拓展
    Ajax概念及基础
    PHP了解01
    CSS3新增功能03
    CSS3新增功能02
    CSS3新增功能01
    html5介绍
    jQuery学习03
  • 原文地址:https://www.cnblogs.com/crelle/p/15045629.html
Copyright © 2011-2022 走看看