【无标题】远程链接服务实战

一、
主机1:

[root@server100 ~]# hostnamectl 
 Static hostname: server.example.com

[root@server100 ~]# useradd timinglee
[root@server100 ~]# passwd timinglee

主机2:

[root@server200 ~]# hostnamectl 
 Static hostname: client.example.com

二、
[root@server200 ~]# ssh-keygen -f /root/.ssh/id_rsa -P ""

[root@server200 .ssh]# cat id_rsa.pub
DOK30= root@client.example.com

[root@server200 .ssh]# ssh-copy-id -i id_rsa.pub root@172.25.254.100

[root@server100 .ssh]# cat authorized_keys
DOK30= root@client.example.com

[root@server100 ~]# vim /etc/ssh/sshd_config
PermitRootLogin yes
AllowUsers timinglee

[root@server100 ~]# systemctl restart sshd

测试:
[root@server200 .ssh]# ssh -l root 172.25.254.100
Activate the web console with: systemctl enable --now cockpit.socket


[root@server200 ~]# ssh -l timinglee 172.25.254.100
Last login: Fri Apr 19 22:46:37 2024 from 172.25.254.200
[timinglee@server ~]$ 

相关推荐

  1. 标题远程服务实战

    2024-04-24 14:40:07       189 阅读
  2. centos宝塔远程服务器怎么?

    2024-04-24 14:40:07       62 阅读
  3. Nestjs 微服务实战 - 动态微服务创建

    2024-04-24 14:40:07       56 阅读
  4. python远程服务器并可以执行shell命令

    2024-04-24 14:40:07       50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-24 14:40:07       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-24 14:40:07       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-24 14:40:07       87 阅读
  4. Python语言-面向对象

    2024-04-24 14:40:07       96 阅读

热门阅读

  1. 预防oracle的漏洞及其提权

    2024-04-24 14:40:07       34 阅读
  2. fps游戏断线重连架构设计

    2024-04-24 14:40:07       29 阅读
  3. 数据结构—单链表实现通讯录

    2024-04-24 14:40:07       32 阅读
  4. 算法第42天动态规划4

    2024-04-24 14:40:07       31 阅读
  5. 捷克营业执照申请

    2024-04-24 14:40:07       39 阅读
  6. office的文件(word、excel、ppt)图标变白

    2024-04-24 14:40:07       93 阅读
  7. websocket 和 eventsource 的区别和应用

    2024-04-24 14:40:07       33 阅读
  8. 解决常见的 `npm install` 报错

    2024-04-24 14:40:07       28 阅读
  9. Python的一些中级用法

    2024-04-24 14:40:07       45 阅读
  10. unity引擎如何构建安卓包

    2024-04-24 14:40:07       29 阅读