ntp时间服务器和ssh免密登录
1.配置ntp时间服务器,确保客户端主机能和服务主机同步时间
一,服务器主机从阿里云同步时间
[root@server ~]# vim /etc/chrony.conf
方法一:是指时间同步服务器的地址,可以改为阿里时间服务器
方法二:删除所有内容,复制阿里开源镜像站的推荐配置
二,重启服务,查看服务器主机是否同步
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# systemctl restart chronyd
[root@server ~]# 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
===============================================================================
^? 203.107.6.88 2 6 3 2 -5684us[-5684us] +/- 26ms
[root@server ~]# timedatectl statusLocal time: 二 2023-03-21 20:58:25 CSTUniversal time: 二 2023-03-21 12:58:25 UTCRTC time: 二 2023-03-21 12:58:25Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yesNTP service: activeRTC in local TZ: no
[root@server ~]# date
2023年 03月 21日 星期二 20:58:38 CST
三,配置允许访问的ip,并重启服务
[root@server ~]# vim /etc/chrony.conf
[root@server ~]# systemctl restart chronyd
四,对于客户端修改主配置文件中时间服务器地址,并重启服务
[root@node ~]# vim /etc/chrony.conf
[root@node ~]# systemctl restart chronyd
五,查看客户端是否同步
[root@node ~]# systemctl restart chronyd
[root@node ~]# 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.111.128 3 6 17 18 -30us[ +108us] +/- 24ms
[root@node ~]# timedatectl statusLocal time: 二 2023-03-21 23:11:09 CSTUniversal time: 二 2023-03-21 15:11:09 UTCRTC time: 二 2023-03-21 15:11:09Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yesNTP service: activeRTC in local TZ: no
[root@node ~]# date
2023年 03月 21日 星期二 23:11:14 CST
2.配置ssh免密登陆,能够通过客户端主机通过redhat用户和服务端主机基于公钥验证方式进行远程连接
一,创建新用户t1
[root@node1 ~]# useradd t1
[root@npde1 ~]# passwd t1
更改用户 t1 的密码 。
新的密码:
无效的密码: 密码少于 8 个字符
重新输入新的密码:
passwd:所有的身份验证令牌已经成功更新。
二,创建新的密钥对,并且发送到指定目录
[t1@node1 root]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa):
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:peN3IXp4nusrQ5Ca/umHNzX6fO6SPJSSf6LCnv2mNc8 redhat@node1
The key's randomart image is:
+---[RSA 3072]----+
| |
| |
| . . |
| o o |
| o .S.... |
| o .++=. . |
| . . o+B*o. |
| . ++BBO*o |
| +*++@X@E |
+----[SHA256]-----+
[t1@node1 root]$
[t1@node1 root]$ ssh-copy-id root@192.168.111.128
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/redhat/.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: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.38.128's password: Number of key(s) added: 1Now try logging into the machine, with: "ssh 'root@192.168.38.128'"
and check to make sure that only the key(s) you wanted were added.
三,客户端测试
[t1@node1 root]$ ssh root@192.168.111.128
Activate the web console with: systemctl enable --now cockpit.socketRegister this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Sat Mar 18 19:58:18 2023 from 192.168.38.136
[root@server ~]#
切换完成
ntp时间服务器和ssh免密登录相关推荐
- Linux运维:Shell脚本实现ssh免密登录远程服务器
LInux系统日常运维过程中,经常需要在本地运行脚本执行对远程主机的命令,正常情况下,ssh登录远程服务器时会提示输入密码,这会影响到脚本的自动执行(因为shell脚本中没有自动填充密码的命令).有三 ...
- ssh免密登录linux服务器
Ssh免密登录 sshd服务 sshd简介: SSH 密钥为登录 Linux 服务器提供了更好且安全的机制.运行 ssh-keygen 后,将会生成公私密钥对.你可以将公钥放置到任意服务器,从持有私钥 ...
- ssh免密登录服务器
ssh ssh是一个方便实用的登录服务器的命令行工具 ssh登录 输入登录命令 ssh user@ip 输入密码 进入服务器 配置并使用HOST别名登录 创建config文件并且配置相关信息 使用别名 ...
- 本地mac配置ssh免密登录远程linux服务器
本地mac配置ssh免密登录远程linux服务器 每次输入密码登录服务器也就罢了,结果scp时每次都要输入密码,分分秒秒阿西吧.哈哈哈,回归正题,配置免密登录后,畅通无阻啊,哈哈哈 检查自己~/.ss ...
- VSCode使用SSH免密登录服务器
VSCode使用SSH免密登录服务器 前言 一.SSH连接服务器 1.1 安装ssh插件 1.2 配置连接 二.免密登录服务器 2.1.生成公钥 2.2.服务器新建授权文件 2.3.本地复制公钥到服务 ...
- Hadoop-2.8.0集群搭建、hadoop源码编译和安装、host配置、ssh免密登录、hadoop配置文件中的参数配置参数总结、hadoop集群测试,安装过程中的常见错误
25. 集群搭建 25.1 HADOOP集群搭建 25.1.1集群简介 HADOOP集群具体来说包含两个集群:HDFS集群和YARN集群,两者逻辑上分离,但物理上常在一起 HDFS集群: 负责海量数据 ...
- ssh免密登录配置(两行命令搞定)
最简单的ssh免密登录的配置 1.准备工作 2.命令行操作 3.互相免密登录 1.准备工作 确保两台服务器的用户名字相同,这里以用户名是username,服务器A要免密登录到服务器B为例子.注意:以下 ...
- liunx使用ssh免密登录
客户端生成公钥和私钥 ssh-keygen 生成的文件会在 cd ~/.ssh 上传公钥到服务器 ssh-copy-id -i ~/.ssh/id_rsa.pub root@服务器ip 3.免密登录 ...
- ssh免密登录配置方法及配置
ssh免密登录配置方法及配置 直接上步骤,记我们本机为机器A,而机器B.机器C等是我们的服务器,我们要配置的是A到B.C等的 ssh 免密登录. 1 在机器A上生成秘钥对 ssh-keygen 会得到 ...
最新文章
- nyoj_518_取球游戏_201404161738
- 《金色梦乡》金句摘抄(二)
- python数组如果余弦_numpy :: 计算特征之间的余弦距离
- python学习方法总结_Python学习总结(一)
- sobel,canny(可滑动调节阈值)边缘检测算法opencv-python实战
- BA-风阀水阀执行器接线图
- SpringBoot读取配置文件
- ROS在rviz中实时显示轨迹(nav_msgs/Path消息的使用)
- Oracle数据库数据恢复方法
- 电子信息一班上传文件教程
- 解决iOS中调用系统中的相机,显示英文标题
- 区块链技术在创造共享经济方面胜过互联网
- java判断硬盘为固态硬盘_怎么看电脑是不是固态硬盘|查询电脑硬盘是HDD还是SSD的方法-系统城...
- 微信小程序 仿朋友圈
- python一个数的阶乘_python整数阶乘计算
- 网络安全:渗透流程之信息收集
- Kuboardv3与监控套件安装
- 软件测试 大概 学到什么程度可以去面试呢
- 微信小程序:scroll-view制作横向滚动导航条特效
- 光敏,红外,人体红外检测模块的模拟输出(ADC)实验——入门
热门文章
- 视频会议系统属于服务器吗,解析视频会议系统结构
- [转]OKapi BM25 算法
- 米灰色房间可以配什么颜色的窗帘?-江南爱窗帘十大品牌
- Relief Visualization Toolbox (RVT)地形因子计算工具
- 软件设计师考试 | 第十一章 标准化和软件知识产权基础知识 | 知识产权基础知识
- Go语言之基本数据类型
- 从零开始搭建DPlayer后端
- TortoiseHG(Mercurial)使用问题和错误总结
- Pytorch填充、步幅及多通道输入输出的理论分析及代码实现
- 三维激光扫描技术在文化旅游项目数字化中的应用