# cat /etc/passwd | egrep -v 'shutdown$|halt$|nologin$|false$|sync$'
[DEBUG] Linux resolve error ‘chmod: changing permissions of ‘resolv.conf’: Operation not permitted’
Error Code:
# chmod 644 resolv.conf
chmod: changing permissions of 'resolv.conf': Operation not permitted
Analysis:
This file is locked by chattr command
Solution:
Step One: Cancel the lock
# chattr -i /etc/resolv.conf
Step Two: Change the file’s privilege
# chmod 644 resolv.conf
Step Three: Relock this file
# chattr +i /etc/resolv.conf
[DEBUG] Linux resolve error code ‘DB version too old ……, expected …… for domain implicit_files!’
Error Code:
# useradd <account name>
DB version too old ......, expected ...... for domain implicit_files!
......
Or:
# chage -l <user name>
DB version too old ......, expected ...... for domain implicit_files!
......
Solution:
Step One: Create /etc/sssd/sssd.conf file
# vim /etc/sssd/sssd.conf
Add follow lines:
[sssd]
enable_files_domain = true
Step Two: Give /etc/sssd/sssd.conf file properly privilege
# chmod 600 /etc/sssd/sssd.conf
Step Three: Restart sssd service
# systemctl restart sssd
Reference:
https://access.redhat.com/solutions/7031304
[现象] Linux 普通用户使用 df -h 命令时不显示挂载的目录
当一个用户没有某些挂载目录的读权限时,使用 df -h 命令会不显示这些目录。但是如果给 df 命令加上 –all 选项,则又可以看到这些目录。例如:
$ df --all
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/mapper/share2 - - - - /test/02
/dev/mapper/share1 - - - - /test/01
[命令] Linux 命令 gpasswd (管理组)
内容一:组的成员管理
1.1 把用户添加到组里
1.1.1 把某个用户添加到某个组
# gpasswd -a <user> <group>
或者:
# gpasswd –add <user> <group>
或者:
# gpasswd -M <group>
或者:
# gpasswd –members <group>
1.1.2 把多个用户添加到某个组
# gpasswd -a <user1>,<user2> <group>
或者:
# gpasswd –add <user1>,<user2> <group>
或者:
# gpasswd -M <user1>,<user2> <group>
或者:
# gpasswd –members <user1>,<user2> <group>
2.2 把用户从组里删除
2.2.1 把某个用户从某个组里删除
# gpasswd -d <user> <group>
或者:
# gpasswd –delete <user> <group>
2.2.2 把多个用户添加到某个组
# gpasswd -d <user1>,<user2> <group>
或者:
# gpasswd –delete <user1>,<user2> <group>
2.3 将某个用户设置为组的管理员
# gpasswd -A <user> <group>
或者:
# gpasswd –administrators <user> <group>
内容三:组的密码管理
3.1 给某个组设置密码
# gpasswd <group>
3.2 删除某个组的密码
# gpasswd –r <group>
或者:
# gpasswd –remove-password <group>
内容四:组的登录管理
限制某个组登录
# gpasswd -R <group>
或者:
# gpasswd –restrict <group>
内容五:显示帮助信息
# gpasswd -h
或者:
# gpasswd -help