• Ubuntu 禁止root用户登录系统


    该功能的原理就是根据password的命令原理实现用户的禁止登录:

      

    shell@iZ620vnh79jZ:~$ passwd -?
    passwd: invalid option -- '?'
    Usage: passwd [options] [LOGIN]
    
    Options:
      -a, --all                     report password status on all accounts
      -d, --delete                  delete the password for the named account
      -e, --expire                  force expire the password for the named account
      -h, --help                    display this help message and exit
      -k, --keep-tokens             change password only if expired
      -i, --inactive INACTIVE       set password inactive after expiration
                                    to INACTIVE
      -l, --lock                    lock the password of the named account
      -n, --mindays MIN_DAYS        set minimum number of days before password
                                    change to MIN_DAYS
      -q, --quiet                   quiet mode
      -r, --repository REPOSITORY   change password in REPOSITORY repository
      -R, --root CHROOT_DIR         directory to chroot into
      -S, --status                  report password status on the named account
      -u, --unlock                  unlock the password of the named account
      -w, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
      -x, --maxdays MAX_DAYS        set maximum number of days before password
                                    change to MAX_DAYS

      -l 参数,lock the password of the named Account ,锁定账号的密码

      因此只需要执行 

      

    passwd -l root

      就可以实现root的禁止登录

  • 相关阅读:
    taotao-manager-service/pom.xml
    Grafana+Prometheus 监控 MySQL
    firewall-cmd 常用命令
    K8S 容器的资源需求、资源限制
    K8S 高级调度方式
    性能测试工具 Locust 安装
    cookie 和 session区别
    K8S 调度器,预选策略,优选函数
    CPU 实用工具
    *(int*)&p
  • 原文地址:https://www.cnblogs.com/bing-yu12/p/7918775.html
Copyright © 2020-2023  润新知