RHCE第二天

1配置ntp时间服务器,确保客户端主机能和服务主机同步时间

开启两台虚拟机

关闭防火墙:systemctl stop firewalld

关闭selinux :setenfore 0

开启NTP服务:查看NTP是否启用  是否安装

 

 [root@server ~]# systemctl restart chronyd
[root@client ~]# systemctl restart chronyd

[root@server ~]# vim /etc/chrony.conf

allow 192.168.159.128 

local stratum 10 

[root@server ~]# systemctl restart chronyd  

[root@client ~]# vim /etc/chrony.conf

pool 192.168.159.100 iburst

[root@client ~]# systemctl restart chronyd

在客户端上身长公钥和私钥

[redhat@Client ~]$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa): 
Created directory '/home/redhat/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/redhat/.ssh/id_rsa.
Your public key has been saved in /home/redhat/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:YhQCHU3brDLryx7gcWngCOIkeV7wc9JjMpC8ZxcyPkM sesame@Client
The key's randomart image is:
+---[RSA 3072]----+
| .++o+o          |
| .o+Eoo=         |
|=.o+BoB.o        |
|*=.o*X.o         |
|..=o*++ S        |
| . = = .         |
|  . o            |
|   o .           |
|   .=.           |
+----[SHA256]-----+

查看是否生成成功

[sesame@client ~]$  ll /home/sesame/ .ssh/

总数量8

-rw-------. 1 sesame sesame 2602 9 月  01  14:24 id_rsa

-rw-r--r--. 1 sesame sesame 570 9 月  01  14:24 id_rsa.pub

将密钥文件发送给服务端

# ssh-copy-id -i /home/redhat/.ssh/id_rsa.pub 192.168.58.129 
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/redhat/.ssh/id_rsa.pub"
The authenticity of host '192.168.58.129 (192.168.58.129)' can't be established.
ECDSA key fingerprint is SHA256:0QNib0jTAOsN3+4i+VIzcCH8VpYyONasl9j2VyenFe0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.58.129's password: 

登陆成功

[sesame@client ~]$ ssh root@192.168.58.129

Activate  the  web  console  with :systemctl  enable --now cokpit.socket


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值