今天装centos最小化版,装好后查看ip补不能显示eth0:
原因是网卡没激活,激活网卡是ifconfig -a
但是激活后还是不行
此时要设置网络
1.修改ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 TYPE=Ethernet ONBOOT=yes #是否开机启用 BOOTPROTO=static #ip地址设置为静态 IPADDR=192.168.0.101 NETMASK=255.255.255.0 |
service network restart
Linux命令行上下翻页查看是: shift+Page Up或shift+Page Down。
配置主机之间的免密SSH登录
******配置主机之间的免密ssh登陆
假如 A 要登陆 B
在A上操作:
%%首先生成密钥对
ssh-keygen (提示时,直接回车即可)
%%再将A自己的公钥拷贝并追加到B的授权列表文件authorized_keys中
ssh-copy-id B
****************************************例:
[root@shizhan ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
09:93:6b:6f:f9:11:7b:6f:98:60:09:57:be:02:2e:04 root@shizhan
The key's randomart image is:
+--[ RSA 2048]----+
| |
| E . . |
| .+ o |
| .+o.. . |
| .o.S+.. . |
| .....=o. |
| .+.oo.o |
| . . oo.. |
| . .. |
+-----------------+
[root@shizhan ~]# ll .ssh
总用量 12
-rw-------. 1 root root 1675 5月 24 04:16 id_rsa
-rw-r--r--. 1 root root 394 5月 24 04:16 id_rsa.pub
-rw-r--r--. 1 root root 395 5月 24 04:05 known_hosts
[root@shizhan ~]# cd .ssh
[root@shizhan .ssh]# ssh-copy-id 192.168.229.6
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Now try logging into the machine, with "ssh '192.168.229.6'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@shizhan .ssh]# cd..
-bash: cd..: command not found
[root@shizhan .ssh]# cd ..
[root@shizhan ~]# ssh 192.168.229.6
Last login: Wed May 24 04:05:22 2017 from 192.168.229.5
在编辑模式下按esc成为一般模式 按shift+zz 即可保存
复制最小化系统的步骤:
1:复制、打开。
2:发现网络有问题,因为ip重复
3、ifconfig -a启动网卡
4、解决克隆后eth0不见的问题
直接修改 /etc/sysconfig/network-scripts/ifcfg-eth0
删掉UUID HWADDR
配置静态地址
然后:rm -rf /etc/udev/rules.d/70-persistent-net.rules
或者修改这个文件:
将其中的物理地址复制给eth0,然后删掉eth1的配置
然后 重启:reboot