1、临时配置网络(ip,网关,dns)+永久配置

临时配置:

网络相关配置

网络相关配置

网络相关配置

网络相关配置

永久配置:

vim /etc/sysconfig/network-scripts/ifcfg-ens33

网络相关配置

(dhcp必须改成static,但是我不想改~)

关防火墙     systemctl stop firewarlld  

                systemctl disable firewalld

关闭SELINUX   vim /etc/sysconfig/selinux

网络相关配置

重启网卡 service network restart

查看 ifconfig

2、为集群内的机器设定主机名,利用/etc/hosts文件来解析自己的集群中所有的主机名,相应的,集群的配置应该改成使用主机名的方式

 hostnamectl set-hostname web1

 hostnamectl set-hostname web2

 vim /etc/hosts

网络相关配置

 vim /etc/hosts

网络相关配置

网络相关配置

网络相关配置

 

3、ssh登陆,scp上传、下载,ssh秘钥登陆,修改ssh server端的端口为8888然后进行登陆和scp测试

ssh登陆:

 网络相关配置

网络相关配置

scp上传、下载:

网络相关配置

网络相关配置

ssh秘钥登陆:

ssh-keygen

ssh-copy-id -i web2

网络相关配置

网络相关配置修改ssh:

vim /etc/ssh/sshd_config

网络相关配置

systemctl restart sshd

网络相关配置

网络相关配置

 

相关文章: