SSH安装与配置

2016-12-06  本文已影响23人  Traim
ssh.png

客户端

如果没有key,首先得生成个 key 。
作为认证凭证

ssh-keygen

运行完成后会在 $HOME/.ssh 目录下产生两个文件

公钥文件用于上传到服务器端。

服务端

环境为 centos。
首先安装 ssh:

yum install openssh-server

启动 && 重启:

systemctl start sshd
systemctl restart sshd

配置文件在:

/etc/ssh/sshd_config

上传的 key 默认存放文件:

~/.ssh/authorized_keys

合并上传的 key 进 authorized_keys:

cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
上一篇 下一篇

猜你喜欢

热点阅读