Jioushan
  • Index
  • Project
  • Firend
  • Travelling
  • Donate
  • About-Me
  • Blog
    • 食用bird
    • 我怎么了?
    • ACME.SH签发Google SSL
    • Fedora 41_start config
    • 2025年Note
    • On The Debian12 amd64 install Zabbix + Grafana
    • Deploy Tiny tiny RSS on server
    • 2024y-11m
    • 5月份
    • 4月份
    • Note-3月份
    • 2024年2月的小记
    • 2024 year
    • Debian 12 apt
    • Debian11 setting
    • 在 Sonoma OS 玩 原神 以及 完整的移除卸載原神
    • 一個人看電影
    • 裝eve-ng社區版踩個小坑
    • 不完整的Gentoo安裝
    • 在archLinux上配置wlan0(wifi)
    • bigsur 側載 運行ipa以及降級至MacOS 11.2.3
    • 记一次丢失GPG公钥
    • 搭建Alist於您的服務器
    • JSMSR Network
    • 硬碟掛載
    • 🌏Wireguard 淺入教程
    • BGP-4作为个人用户的看待
    • 在树莓派4B上使用Airplay
    • 🌏bird版本區別之 protocol
    • 🌏在Debian上bird的打開方式前言
    • 😆ssh-key来访问SSH
    • 😆临时修改网卡地址 网关 Mac地址
    • 😄Ubuntu Install Bird2
    • 🗒️緩解服務器壓力,一種思路
    • 🌏在公網宣告地址須知
    • 🗒️云游戏II
    • 😖自己的闲言碎语
    • 🧑‍💻Sony xperia docomo XZ2C 回退系统
    • 🗒️Big Sure 入门指北
    • 泛談科學協議選擇
    • 🧑‍💻给Skura主题添加个性的LOGO
    • NVIDIA GeForce NOW 评测
    • Linux系统换清华镜像源
    • 国内三大运营商对于大厂的路由跟踪如何。
    • SPD与STPD
    • Polybridge的正确通关方式?砸?
    • CDN机房节点切换加快http访问--ws+TLS+CDN协议加速CDN访问。
    • 搭建私人图床
    • 迁移chevrto图床
    • 已经死去灵魂的人
    • 树莓派的坑!玩pi必知!
    • CDN抉择
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Blog

ssh-key来访问SSH

root登录环境下!

首先咱应该利用 Linux自带的SSH-key来生成公钥和私钥 (加密RSA)

ssh-keygen -t rsa

然后回车三次 (嗯,是回车三次

我们进入这个隐藏的目录

cd /root/.ssh

ls查看目录下文件

你会看到有两个文件 .pub的是公钥,自然另一个就是私钥,想办法自己下载下来私钥的内容,保存好,我们ssh登录要用到它。

键入下面命令

cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
chmod 600 authorized_keys

然后vim编辑一下ssh_d文件

vim /etc/ssh/sshd_config

别告诉我 你ssh还没安装(噗 (题外话 apt-get install ssh

然后找到config下面的内容 取消注释 或者 没有内容咱就自己在最下面 加上

RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys

如果你想取消root 通过密码登录,可以把 yes 改为no

PasswordAuthentication no

然后键入这步命令 重启ssh 进程

/etc/init.d/ssh restart

「OK」

状态为ok 我们就可以通过我们的私钥来登录我们的ssh会话服务器啦!

Previous在Debian上bird的打開方式前言Next临时修改网卡地址 网关 Mac地址

Last updated 2 years ago

Was this helpful?

😆