sshで公開鍵認証するときにいつもすること
たまに設定するとこけるときがあるので備忘録
RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
option:enable
title:sshd_config
ログイン先の CentOS 7で行った操作.
[mocchi@virtualhost ~]$ mkdir $HOME/.ssh [mocchi@virtualhost ~]$ touch $HOME/.ssh/authorized_keys [mocchi@virtualhost ~]$ chmod 755 $HOME [mocchi@virtualhost ~]$ chmod 755 $HOME/.ssh [mocchi@virtualhost ~]$ chmod 644 $HOME/.ssh/authorized_keys [mocchi@virtualhost ~]$ cat your_key.pub >> $HOME/.ssh/authorized_keys [mocchi@virtualhost ~]$ sudo systemctl restart sshd.service
option:enable
title: operation
style:terminal