12

设置Linux系统SSH-KEY访问方式设置

 4 years ago
source link: https://www.wencst.com/archives/150
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

设置Linux系统SSH-KEY访问方式设置

作者: wencst 分类: linux,Uncategorized 发布时间: 2016-08-22 17:56 阅读: 1,784 次

客户端设置

Windows

安装Git,打开git bash:

ssh-keygen -t rsa

切记要输入密码,以防被人拷贝走公钥私钥,依然有密码作为最后一道防线。

Linux

将会生成密钥文件和私钥文件id_rsa,id_rsa.pub或id_dsa,id_dsa.pub

ssh-keygen -t [rsa|dsa]

服务端设置

拷贝客户端秘钥

从Ftp中将客户端拷贝公钥文件id_rsa.pub到/root下,然后进入到/root,将公钥添加到authorized_keys中

cd /root
cat id_rsa.pub >> ~/.ssh/authorized_keys

修改SSH配置

vi /etc/ssh/sshd_config

修改关键几个参数

重启SSH服务

service sshd restart

客户端连接

连接端口需要与上述sshd_config中的Port对应

如果文章对您有用,扫一下支付宝的红包,不胜感激!

欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)


Recommend

  • 48
    • www.tuicool.com 6 years ago
    • Cache

    Generating an SSH key on Windows

    I needed an SSH key. First I needed to the WSL subsystem, and once I had that working, I could do the work I needed to do: get an SSH key. There is a utility to help with this on Linux, called ssh-keygen. You run this at...

  • 18
    • lunashu.org 4 years ago
    • Cache

    git clone 指定 ssh-key

    git clone 指定 ssh-key 其实我们往往会遇到这样一个问题 打个比方: 公司邮箱是:[email protected] 个人邮箱:[email protected] & [email protected] 我们分别有:公司git仓库 / github仓库...

  • 35
    • www.cnblogs.com 4 years ago
    • Cache

    指定ssh key访问git

    最近在用git,感觉每次输入密码很不方便,想借助ssh key来实现(一种类似ssh命令中-i参数的机制)。现在问题解决了,这里总结下(从建库开始),也方便我以后查阅。 建立一个私有仓库 这里以test1目录示例:1、创建test1文件夹 ...

  • 16
    • www.vidarholen.net 4 years ago
    • Cache

    What’s in a SSH RSA key pair?

    What’s in a SSH RSA key pair? You probably have your own closely guarded ssh key pair. Chances are good that it’s based on RSA, the default choice in ssh-keygen. RSA...

  • 21
    • www.devdungeon.com 4 years ago
    • Cache

    How to Specify SSH key for Git repository

    Introduction If you are using SSH keys with Git to clone and pull your repositories, you may have to manage several SSH keys. For example, it is common to setup a "deploy key" in GitHub (Repository | Settings | Deploy Keys

  • 20

    還原被碼掉的 PEM 資訊 (SSH RSA key) 在「Recovering a full PEM Private Key when half of it is redacted」這邊看到的,起因是

  • 19

    炎忍的博客在 Windows 系统上给 ssh 设置代理发表于2020-06-01|更新于2020-11-25|技术记录字...

  • 11

    GitHub 支援 SSH 使用 Security Key 了 GitHub 宣佈支援使用 security key 的 SSH key 操作了:「Security keys are...

  • 10

    How to Use SSH-Keygen to Generate an SSH Key on Mac By Matt Moore Published 1 day ago Follow this simple guide to create an SSH key...

  • 10

    openwrt 给普通用户设置 ssh 私钥访问 2022-03-13 技术 暂无评论 3...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK