码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 配置ssh免密登陆:客户端主机通过redhat用户基于秘钥验证方式进行远程连接服务器的root用户


    服务器root用户:

    1. [root@localhost ~]# ifconfig
    2. ens160: flags=4163 mtu 1500
    3. inet 192.168.146.128 netmask 255.255.255.0 broadcast 192.168.146.255
    4. inet6 fe80::20c:29ff:fe2c:de8 prefixlen 64 scopeid 0x20<link>
    5. ether 00:0c:29:2c:0d:e8 txqueuelen 1000 (Ethernet)
    6. RX packets 309 bytes 30419 (29.7 KiB)
    7. RX errors 0 dropped 0 overruns 0 frame 0
    8. TX packets 247 bytes 24604 (24.0 KiB)
    9. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    10. lo: flags=73 mtu 65536
    11. inet 127.0.0.1 netmask 255.0.0.0
    12. inet6 ::1 prefixlen 128 scopeid 0x10
    13. loop txqueuelen 1000 (Local Loopback)
    14. RX packets 17 bytes 2039 (1.9 KiB)
    15. RX errors 0 dropped 0 overruns 0 frame 0
    16. TX packets 17 bytes 2039 (1.9 KiB)
    17. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    客户端:

    创密钥:

    [redhat@localhost root]$ ssh-keygen
    

    密钥:

    1. [redhat@localhost root]$ ll /home/redhat/.ssh
    2. 总用量 8
    3. -rw-------. 1 redhat redhat 2622 3月 14 20:55 id_rsa
    4. -rw-r--r--. 1 redhat redhat 582 3月 14 20:55 id_rsa.pub

    传密钥给服务器root用户:

    [redhat@localhost root]$ ssh-copy-id root@192.168.146.128
    

    远程连接服务器root用户:

    1. [redhat@localhost root]$ ssh 'root@192.168.130.128'
    2. Activate the web console with: systemctl enable --now cockpit.socket
    3. Register this system with Red Hat Insights: insights-client --register
    4. Create an account or view all your systems at https://red.ht/insights-dashboard
    5. Last failed login: Tue Mar 14 20:59:14 CST 2023 from 192.168.130.129 on ssh:notty
    6. There was 1 failed login attempt since the last successful login.
    7. Last login: Tue Mar 14 20:51:16 2023 from 192.168.146.1
    8. [root@localhost ~]#

  • 相关阅读:
    USB转串口芯片CH340系列及CH340模块使用方法(CH340驱动,接线,串口下载详细介绍)
    用hadoop-eclipse-plugins-2.6.0来配置hadoop-3.3.6
    Java mail发送邮件时卡住,没有任何异常日志(出现阻塞线程)
    IProgress not found.Please update jupyter and ipywidgets.解决办法
    Selenium元素定位方法总结
    GPT SOVITS项目 一分钟克隆 (文字输出)
    前后端分离毕设项目之springboot同城上门喂遛宠物系统(内含文档+源码+教程)
    springboot+基层慢性病信息管理系统 毕业设计-附源码221550
    23设计模式详解「全23种」
    【数据库】B树、B+树、索引
  • 原文地址:https://blog.csdn.net/m0_63636799/article/details/133997100
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号