我的linux学习日记day10

一、网络会话

RHEL7系统支持网络会话功能,允许用户在多个配置文件中快速切换(非常类似于firewalld防火墙服务中的区域技术)。如果我们在公司网络中使用笔记本电脑时需要手动指定网络的IP地址,而回到家中则是使用DHCP自动分配IP地址。这就需要麻烦地频繁修改IP地址,但是使用了网络会话功能后一切就简单多了—只需在不同的使用环境中激活相应的网络会话,就可以实现网络配置信息的自动切换了

创建:

nmcli connection add con-name 名称 type ifname 网卡名

查看:

nmcli connection show

切换

nmcli connection up 名称

二、网卡绑定

常见的网卡绑定驱动有三种模式——mode0   mode1  mode6 

mode0(平衡负载模式):平时两块网卡均工作,且自动备援,但是要在与本地网卡相连的交换机设备上进行端口聚合来支持绑定技术;

mode1(自动备援模式):平时只有一块网卡工作,在它故障后自动替换为另外的网卡

mode6(平衡负载模式):平时两块网卡均工作,且自动备援无需交换机设备提供辅助支持

[root@network-scripts]#cat ifcfg-eth0 
DEVICE=eth0 
TYPE
=Ethernet
ONBOOT
=yes
BOOTPROTO
=none
MASTER
=bond0
SLAVE
=yes
[root@network-scripts]#cat ifcfg-eth1    
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes 
[root@network-scripts]#cat ifcfg-bond0     //需要手工创建
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.0.10
NETMASK=255.255.255.0
DNS2=4.4.4.4
GATEWAY=10.0.0.2
DNS1=10.0.0.2
[root@~]# vim /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=100 mode=6
[root@ ~]# systemctl restart network
[root@ ~]# ifconfig

三、SSH服务

SSH 为 Secure Shell 的缩写 

ssh认证类型:

1、口令

ssh 192.168.10..10

2.基于密钥认证

  客户端生成一对密钥

# ssh-keygen -t dsa

[root@.ssh]# ls
id_dsa id_dsa.pub known_hosts

  将客户端的公钥传到服务器端

ssh-copy-id 192.168.10.10
[root@ ~]# vim /etc/ssh/sshd_config 

 75 # To disable tunneled clear text passwords, change to no here!
 76 #PasswordAuthentication yes
 77 #PermitEmptyPasswords no
 78 PasswordAuthentication no

#systemctl restart sshd

scp远程传输命令

传输:

# scp /文件名称 root@ip:目录名

下载:

#scp 服务器Ip :目录/文件  本地目录

原文地址:https://www.cnblogs.com/miracle1989/p/12944473.html