首页 > 其他 > 详细

Centos 7新手上路

时间:2015-12-11 19:02:46      阅读:227      评论:0      收藏:0      [点我收藏+]

一、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端口

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


Centos 7新手上路

原文:http://tianshili.blog.51cto.com/5050423/1722079

(0)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!