Centos 7新手上路
2015-12-11 16:01
567 查看
一、Centos 7 修改SSH端口号
1、修改/etc/ssh/sshd_config
vi /etc/ssh/sshd_config
#Port 22 在这行下添加下面这行
Port 7156 //下面添加这一行
2、修改SELinux
使用以下命令查看当前SElinux 允许的ssh端口:
安装semanage,
yum -y install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 7156
然后确认一下是否添加进去
semanage port -l | grep ssh
如果成功会输出
ssh_port_t tcp 7156, 22
3、重启ssh
systemctl restart sshd (systemctl restart sshd.service)
4、firewall开放ssh端口
yum -y install firewalld;
systemctl enable firewalld;
systemctl start firewalld; //安装启动 firewall
firewall-cmd --zone=public --add-port=7156/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all-zones |grep 7156 //查看结果
二、无 ifconfig命令,可用yum search ifconfig 查询包
yum -y install net-tools
三、hostname保存目录
/etc/hostname
1、修改/etc/ssh/sshd_config
vi /etc/ssh/sshd_config
#Port 22 在这行下添加下面这行
Port 7156 //下面添加这一行
2、修改SELinux
使用以下命令查看当前SElinux 允许的ssh端口:
安装semanage,
yum -y install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 7156
然后确认一下是否添加进去
semanage port -l | grep ssh
如果成功会输出
ssh_port_t tcp 7156, 22
3、重启ssh
systemctl restart sshd (systemctl restart sshd.service)
4、firewall开放ssh端口
yum -y install firewalld;
systemctl enable firewalld;
systemctl start firewalld; //安装启动 firewall
firewall-cmd --zone=public --add-port=7156/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all-zones |grep 7156 //查看结果
二、无 ifconfig命令,可用yum search ifconfig 查询包
yum -y install net-tools
三、hostname保存目录
/etc/hostname
相关文章推荐
- Centos6 编译安装Python
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- CentOS 6.2实战部署Nginx+MySQL+PHP
- CentOS 7系统配置上的变化解析
- CentOS下DB2数据库安装过程详解
- CentOS 6.3下编译安装Ruby 2.0笔记
- Fedora Linux 7 Test 4 发布 下载地址
- Internet Explorer 7 中文版发布
- WinRAR v3.7 Beta 7 简体中文破解版 下载
- 在Centos 5.5 上编译安装mysql 5.5.9
- CentOS 6.5源码安装Erlang教程
- 在CenOS系统下安装和配置Redis数据库的教程
- centos 5.6 升级php到5.3的方法
- CentOS mysql安装系统方法
- centos下安装mysql服务器的方法
- CentOS 5.1 4.6最新官方下载地址列表
- Centos搭建GTK+Codeblock完整版