[root@www ~]# grep SELINUX /etc/selinux/config# SELINUX= can take one of these three values:SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:SELINUXTYPE=targeted
[root@www ~]# grep ^SELINUX /etc/selinux/configSELINUX=enforcing
SELINUXTYPE=targeted
(2)查找/etc/ssh/sshd_config 以no结尾的行
[root@www ~]# grep no$ /etc/ssh/sshd_config#HostbasedAuthentication no#IgnoreUserKnownHosts no#PermitEmptyPasswords no
ChallengeResponseAuthentication no
#KerberosAuthentication no#KerberosGetAFSToken no
GSSAPICleanupCredentials no
#GSSAPIKeyExchange no#GSSAPIEnablek5users no#GatewayPorts no
PrintMotd no
#PermitUserEnvironment no#UseDNS no#PermitTunnel no# X11Forwarding no# AllowTcpForwarding no# PermitTTY no
(3)过滤/etc/ssh/sshd_config 包含数字的行
[root@www ~]# grep [0-9] /etc/ssh/sshd_config# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 t j Exp $# sshd_config(5) for more information.#Port 22#ListenAddress 0.0.0.0
HostKey /etc/ssh/ssh_host_ed25519_key
# For more information, see manual page for update-crypto-p olicies(8).#LoginGraceTime 2m#MaxAuthTries 6#MaxSessions 10# The default is to check both .ssh/authorized_keys and .ss h/authorized_keys2#GSSAPIEnablek5users no
X11Forwarding yes#X11DisplayOffset 10#X11UseLocalhost yes#ClientAliveInterval 0#ClientAliveCountMax 3#MaxStartups 10:30:100# X11Forwarding no
2、文本处理命令:
(1)使用cut命令将当前主机的ip地址切割显示
[root@www ~]# ip a |head -9 |tail -1 |cut -c 10-24192.168.156.129