报错代码:
SIOCADDRT: File Exists
解决方法:
确保以下目录中,网卡配置文件的 IP 地址只出现过了 1 次
/etc/sysconfig/network-scripts
SIOCADDRT: File Exists
确保以下目录中,网卡配置文件的 IP 地址只出现过了 1 次
/etc/sysconfig/network-scripts
# loginctl -a
SESSION UID USER SEAT TTY
27 1001 mingyuzhu pts/0
(
补充:从输出结果可以看出
1) 会话\进程的 SESSION 号码为 27
2) 创建会话\进程的用户 UID 是 1001
3) 创建会话\进程的用户是 mingyuzhu
4) 创建会话\进程的 SEAT TTY 是 pts/0
)
# loginctl terminate-session 27
(补充:这里以关闭 SESSION 号码是 27 的会话\进程为例)
# loginctl -a | grep mingyuzhu| awk '{print "loginctl terminate-session "$1;system("loginctl terminate-session "$1"")}'
# loginctl -a | grep mingyuzhu| awk '{print "loginctl terminate-session "$1;system("loginctl terminate-session "$1"")}' > /dev/null
或者:
# loginctl -a | grep mingyuzhu| `awk '{print "loginctl terminate-session "$1;system("loginctl terminate-session "$1"")}'`
[error] [/....../system-auth] has unexpected content!
[error] [/....../password-auth] has unexpected content!
[error] [/....../nsswitch.conf] has unexpected content!
[error] Unexpected changes to the configuration were detected.
[error] Refusing to activate profile unless those changes are removed or overwrite is requested.
Some unexpected changes to the configuration were detected. Use 'select' command instead.
# mv /etc/authselect/custom/password-policy /etc/authselect/custom/password-policy-backup
# authselect create-profile password-policy -b sssd --symlink-meta --symlink-pam
# authselect select custom/password-policy with-sudo with-faillock without-nullok with-mkhomedir --force
# dnf install oddjob ; systemctl enable --now oddjobd.service
# authselect apply-changes
偏移位置变量,默认偏移 1 位,也就是说第 1 个位置变量的值会被第 2 个位置变量的值取代。
如果 shift 后面添加数字,则会直接偏移对应数字个位置。例如 shift 4 则代表直接偏移 4 个位置变量,此时第 1 个位置变量的值会被第 5 个位置变量的值取代。
(注意:shift 不能偏移成负数,且当剩下的位置变量数量不够 shift 偏移时,shift 则不会偏移)
# vim test.sh
创建以下内容:
#!/bin/bash
while [ $# != 0 ];do
echo $1
done
. test.sh a1 b2 c3 d4 e5
a1
a1
a1
a1
a1
a1
......
#!/bin/bash
while [ $# != 0 ];do
echo $1
shift
done
. test.sh a1 b2 c3 d4 e5
a1
b2
c3
d4
e5
# vim test.sh
创建以下内容:
#!/bin/bash
while [ $# != 0 ];do
echo $1
done
. test.sh a1 b2 c3 d4 e5
a1
a1
a1
a1
a1
a1
......
#!/bin/bash
while [ $# != 0 ];do
echo $1
shift 5
done
. test.sh a1 b2 c3 d4 e5
a1
# cat /var/log/audit/audit.log | grep test.txt
......
type=PATH msg=audit(1532475291.426:18858423)......
......
(
补充:
1) 这里以查看在 audit 日志中文件 test.txt 被修改的记录为例
2) 从这里的输出结果可以看到此次的修改记录中日志的编号是 18858423
)
# cat /var/log/audit/audit.log | grep ppid | grep 18858423
......
...... ppid=6027281 ......
......
(
补充:
1) 这里以查看在 audit 日志中和日志编号 18858423 相同的的日志里记录的 PPID 为例
2) 这里的日志编号 18858423 是在步骤一中查到的
3) 从这里的输出结果可以看到和此日志编号相同的日志里记录的 PPID 是 6027281
)
# cat /var/log/messages | grep terminal=ssh | grep 6027281
(
补充:
1) 这里以查看在系统日志中哪个用户登录系统时生成的是 PPID 6027281 为例
2) 这里的 PPID 6027281 是在步骤二中查到的
)