zoukankan      html  css  js  c++  java
  • linux用户及密码相关

    linux用户相关

    /etc/default/useradd       #linux添加用户的默认配置文件

    /etc/login.defs        #linux用户登陆配置文件

    /etc/skel          #用户目录架构相关的配置文件

    Linux密码相关

    启动linux,进入内核模式,按"e" --------》选择进入相应的内核,找到linux16所在的行,在行尾输入“rd.break“ --------》按”Ctrl+x“进入单用户模式 ---------》”mount -o  rw.remount /sysroot“重新挂载新根,赋予读写权限 -------》"chroot /sysroot",进入到新根 -------》”vim   /etc/passwd“ 修改用户登陆shell信息,”passwd  root“修改账号登陆密码 --------》”touch  /.autorelabel“,创建.autorelabel文件,因为selinux开启的原因,需要用到,否则无法启动,会出现卡进度条的现象。出现卡进度条现象时,可以按键盘F5键,查看启动状态信息。按esc键,显示进度条读取的进度。

    [root@x112 ~]# sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Max kernel policy version:      28
    [root@x112 ~]# getenforce 
    Enforcing
    [root@x112 ~]# cat /etc/selinux/config 
    
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    #SELINUX=disabled
    SELINUX=enforcing
    # SELINUXTYPE= can take one of three two values:
    #     targeted - Targeted processes are protected,
    #     minimum - Modification of targeted policy. Only selected processes are protected. 
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted 
    

    selinux在linux7单用户模式,一直显示为disabled,但是/etc/selinux/config中的配置只要是enforcing,重启生效,就代表selinux是开启状态。

  • 相关阅读:
    [LeetCode] Trips and Users 旅行和用户
    [LeetCode] Rising Temperature 上升温度
    [LeetCode] Delete Duplicate Emails 删除重复邮箱
    [LeetCode] Department Top Three Salaries 系里前三高薪水
    Spring boot Jackson基本演绎法&devtools热部署
    使用spring tool suite(STS)工具创建spring boot项目和出现错误后的处理
    Spring Boot 2.0官方文档之 Actuator
    springboot 使用webflux响应式开发教程(二)
    SpringBoot在自定义类中调用service层等Spring其他层
    springBoot单元测试-模拟MVC测试
  • 原文地址:https://www.cnblogs.com/xiaofeng666/p/12182121.html
Copyright © 2011-2022 走看看