待更新~

初次安装好 CentOS 7 系统后,还需对 SSH 进行简单配置,才可使用 root 或其他用户远程登录。

检查是否已安装 openssh-server

行内代码 inline

yum list installed | grep openssh-server
something
cd /usr/local/etc
cp php.ini php.ini.bak
vi php.ini
/usr/local/etc
uname -a # comment
.example-gradient {
    background: -moz-linear-gradient(left,  #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* FF3.6+ */
    background: -webkit-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* IE10+ */
    background: linear-gradient(to right,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* W3C */
}
.example-angle {
    transform: rotate(10deg);
}
.example-color {
    color: rgba(255, 0, 0, 0.2);
    background: purple;
    border: 1px solid hsl(100,70%,40%);
}
.example-easing {
    transition-timing-function: linear;
}
.example-time {
    transition-duration: 3s;
}

查看 SELinux 状态及关闭 SELinux

1. 查看 SELinux 状态

/usr/sbin/sestatus -v
SELinux status:    disabled
getenforce
Disabled

2. 临时关闭 SELinux

使用下列命令设置 SELinuxpermissive 模式:

setenforce 0 # setenforce 1 设置 SELinux 为 enforcing 模式

3. 永久关闭 SELinux

永久关闭 SELinux 需要修改配置文件重启机器

首先编辑 /etc/selinux/config 文件,将 SELINUX=enforcing 改为 SELINUX=disabled

# 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
# 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。

SSH Keys

配置 VNC

关闭防火墙

更新 Yum 源

相关资料

  1. CentOS 7 安装和配置 SSH | 开源中国
  2. 虚拟机下 CentOS 7 开启 SSH 连接 | CSDN
  3. SSH 原理与运用(一):远程登录 | 阮一峰
  4. SSH 原理与运用(二):远程操作与端口转发 | 阮一峰
  5. OpenSSH
  6. ssh(1) - Linux man page
  7. SSH 命令 | Linux 命令大全
  8. 查看 SELinux状态及关闭SELinux | 51 CTO