服務器初始化

服務器初始化

/ 設置主機名 /
/ 配置sshd快速鏈接 /
Last login: Mon Dec 17 09:14:45 on ttys001
ChaodeMacBook-Pro:~ chaoliu$
ChaodeMacBook-Pro:~ chaoliu$ ssh [email protected]
The authenticity of host '192.168.13.251 (192.168.13.251)' can't be
established.
ECDSA key fingerprint is
SHA256:qD06giqI3l2BW0j/i6HpljGVtUBjbc1b/MTG/XeSD50.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.13.251' (ECDSA) to the list of known
hosts.
[email protected]'s password:
Last login: Mon Dec 17 09:09:09 2018 from 192.168.13.1
[root@jx_001 ~]#
[root@jx_001 ~]#
[root@jx_001 ~]# localhost^C
[root@jx_001 ~]#
[root@jx_001 ~]# hostnamectl set-hostname nodes_001
[root@jx_001 ~]# exit
登出
Connection to 192.168.13.251 closed.
ChaodeMacBook-Pro:~ chaoliu$ ssh [email protected]
[email protected]'s password:
Last login: Mon Dec 17 09:22:33 2018 from 192.168.13.1
[root@nodes_001 ~]#
ChaodeMacBook-Pro:~ chaoliu$ ssh [email protected]
[email protected]'s password:
Last login: Mon Dec 17 09:24:43 2018 from 192.168.13.1
[root@nodes_001 ~]# vi /etc/ssh/sshd_config
利⽤/搜索DNS, 使⽤的是末⾏模式的/搜索
把UseDNS yes 改成 UseDNS no, 並且去掉前⾯的#
[root@nodes_001 ~]# systemctl restart sshd
/ 關閉防⽕牆和SELinux /
/ 配置yum倉庫 /
CentOS6 -- iptables
CentOS7 -- firewalld
ChaodeMacBook-Pro:~ chaoliu$ ssh [email protected]
[email protected]'s password:
Last login: Mon Dec 17 09:26:31 2018 from 192.168.13.1
[root@nodes_001 ~]#
[root@nodes_001 ~]# systemctl stop firewalld
[root@nodes_001 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multiuser.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbusorg.fedoraproject.FirewallD1.service.
[root@nodes_001 ~]#
[root@nodes_001 ~]# sed -ri s/SELINUX=enforcing/SELINUX=disabled/g
/etc/selinux/config
[root@nodes_001 ~]# setenforce 0
[root@nodes_001 ~]# getenforce
Permissive
[root@nodes_001 ~]#
yum倉庫地址: mirrors.aliyun.com
--在瀏覽器中輸⼊該地址, 找到centos點擊右側的幫助複製CentOS 7下⾯的curl指令
--找到epel點擊右側的幫助複製RHEL 7下⾯的指令, 並在命令終端中把 wget -O 換成 curl<br/>-o
[root@nodes_001 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 2523 100 2523 0 0 20303 0 --:--:-- --:--:-- --:--:--
20512
[root@nodes_001 ~]#
[root@nodes_001 ~]# wget -O /etc/yum.repos.d/epel.repo
http://mirrors.aliyun.com/repo/epel-7.repo
-bash: wget: 未找到命令
[root@nodes_001 ~]# curl -o /etc/yum.repos.d/epel.repo
http://mirrors.aliyun.com/repo/epel-7.repo
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 664 100 664 0 0 3722 0 --:--:-- --:--:-- --:--:--
3751
[root@nodes_001 ~]#
[root@nodes_001 ~]# yum clean all
已加載插件:fastestmirror
正在清理軟件源: base epel extras updates
[root@nodes_001 ~]# yum makecache

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章