RHCE第二次作业

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

第一修改server端把服务器改为阿里云的然后允许node1端同步

#修改配置文件
#vim /etc/chrony.conf
 
server ntp.aliyun.com iburst
 
allow 192.168.253.130/24

第二修改node1的配置文件

​server 192.168.253.129 iburst

然后重启服务和检查时间服务器是否是客户端的地址

[root@node1 ~]# chronyc sources -v
 
  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? 192.168.253.129               3   6     3     1   +654ms[ +654ms] +/-   37ms

2.配置ssh免密登陆,能够实现客户端主机通过服务器端的redhat账户进行基于公钥验证方式的远程连接

第一步定位node1制作公钥和私钥

[root@node1 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
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:TLz00O1pdhckH4edRFIfTTnzIpmWFbf7ShSL4YNftV4 root@node1
The key's randomart image is:
+---[RSA 3072]----+
|             o=%B|
|       . . .  B*O|
|        = . o=.+*|
|       + + +*+.+=|
|        S o.O.=+E|
|           + =..o|
|            . ...|
|             . . |
|              .  |
+----[SHA256]-----+

第二步定位node1,上传公钥

[root@node1 ~]# ssh-copy-id  root@192.168.48.129
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/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:行183: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_tmp_id: 没有那个文件或目录
/usr/bin/ssh-copy-id:行189: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
grep: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
/usr/bin/ssh-copy-id:行202: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
cat: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_tmp_id: 没有那个文件或目录
 
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
                (if you think this is a mistake, you may want to use -f option)
  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值