zoukankan      html  css  js  c++  java
  • linux系统中禁止用户登录与解锁禁止用户登录

    1、使用usermod -L 选项限制用户登录

    [root@linuxprobe home]# usermod -L linuxprobe ##禁止用户linuxprobe登录
    [root@linuxprobe home]# passwd -S linuxprobe  ## 查看状态,锁定状态
    linuxprobe LK 2020-10-19 0 99999 7 -1 (Password locked.)

    登录测试:

    login as: linuxprobe  ## 无法登录
    linuxprobe@192.168.3.13's password:
    Access denied
    linuxprobe@192.168.3.13's password:
    Access denied
    linuxprobe@192.168.3.13's password:

    使用usermod -U选项解除登录限制

    [root@linuxprobe home]# passwd -S linuxprobe  ## 解除登录限制
    linuxprobe PS 2020-10-19 0 99999 7 -1 (Password set, SHA512 crypt.)

    登录测试:

    login as: linuxprobe    ## 成功登录
    linuxprobe@192.168.3.13's password:
    Last failed login: Mon Oct 19 22:40:56 CST 2020 from 192.168.3.4 on ssh:notty
    There were 4 failed login attempts since the last successful login.
    Last login: Mon Oct 19 22:37:08 2020 from 192.168.3.4

    2、使用passwd -l选项禁止用户登录

    [root@linuxprobe home]# passwd -l linuxprobe  ##禁止用户linuxprobe登录
    Locking password for user linuxprobe.
    passwd: Success
    [root@linuxprobe home]# passwd -S linuxprobe  ## 查看用户状态
    linuxprobe LK 2020-10-19 0 99999 7 -1 (Password locked.)

    登录测试:

    login as: linuxprobe   ## 无法登录
    linuxprobe@192.168.3.13's password:
    Access denied
    linuxprobe@192.168.3.13's password:
    Access denied
    linuxprobe@192.168.3.13's password:

    使用passwd  -u选项接触登录限制

    [root@linuxprobe home]# passwd -u linuxprobe ## 解除登录限制
    Unlocking password for user linuxprobe.
    passwd: Success
    [root@linuxprobe home]# passwd -S linuxprobe  ## 查看状态
    linuxprobe PS 2020-10-19 0 99999 7 -1 (Password set, SHA512 crypt.)

    登录测试:

    login as: linuxprobe  ## 可以登录
    linuxprobe@192.168.3.13's password:
    Last failed login: Mon Oct 19 22:48:14 CST 2020 from 192.168.3.4 on ssh:notty
    There were 2 failed login attempts since the last successful login.
    Last login: Mon Oct 19 22:44:25 2020 from 192.168.3.4
  • 相关阅读:
    SCRIPT TO GENERATE SQL*LOADER CONTROL FILE
    Setting an Oracle event:The structure of the trace syntax
    Script to Collect RAC Diagnostic Information (racdiag.sql)
    Data Block Cache Header Format Changes (Oracle8 Physical layout)
    Function Based Indexes and Global Temporary Tables
    EVENT: 10231 "skip corrupted blocks on _table_scans_"
    Materialized Views and Dimensions
    Script: Computing Table Size
    DBMS_REPAIR example
    Sql2005+:ssms 的【临时】服务器连接配置文件:
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/13843700.html
Copyright © 2011-2022 走看看