配置时间服务器
在服务器端进行你向别的时间服务器进行时间的同步
vim /etc/chrony.conf ##打开对应的配置文件
server ntp.aliyun.com iburst ##在配置文件将时间同步的服务器改为阿里的时间服务器
allow 192.168.190.0/24 ## 在配置文件中允许客户端进行访问
systemctl restart chronyd ## 重启服务
注意:在配置文件中allow前面的#必须删除;allow后面加和客户端在同一个网段的地址
在客户端进行向搭建的时间服务器进行时间同步
vim /etc/chrony.conf ##打开对应的配置文件
pool 192.168。190.129 iburst ##在配置文件将时间同步的服务器改为搭建的时间服务器
systemctl restart chronyd ## 重启服务
chronyc sources -v ## 测试是否同步
配置远程登录服务器
首先在服务器增加一个用户redhat
[root@server ~]# useradd redhat
[root@server ~]# passwd redhat
更改用户 redhat 的密码 。
新的密码:
无效的密码: 密码少于 8 个字符
重新输入新的密码:
passwd:所有的身份验证令牌已经成功更新。
第二在客户端进行密钥对的制作以及上传秘钥
[root@node1 ~]# ssh-keygen -t rsa
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:
SHA256:oKCz+ikccuPZ5VCN+MJ5oUtNp14T+cBNqnmWTIIxbMw root@node1
The key's randomart image is:
+---[RSA 3072]----+
| + |
| E . |
| .. =.+ = |
| . .o.*.X . |
|o ..B XS= |
|.+o B O B . |
|+o.= O + . |
|o.o.o o |
|.oo |
+----[SHA256]-----+
[root@node1 ~]# ssh-copy-id redhat@192.168.190.129
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.190.129 (192.168.190.129)' can't be established.
ED25519 key fingerprint is SHA256:7tSwZETzWZDpuoJqvEHCyE64IrhnTVKqjo7SxFoTIa0.
This key is not known by any other names
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
redhat@192.168.190.129's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'redhat@192.168.190.129'"
and check to make sure that only the key(s) you wanted were added.
测试
[root@node1 ~]# ssh redhat@192.168.190.129
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
[redhat@server ~]$