私のリモート マシンには という 2 人のユーザーがいます。1 人は でroot
、もう 1 人は です。そして、 userというAlexander
新しいユーザーを作成します。fit
root
# adduser fit
そして、自宅のマシンの をscp
authorized_keysに追加します。id_rsa.pub
fit@remote_machine
fit$ cat id_rsa.pub >> ~/.ssh/authorized_keys
しかし、その後もリモートマシンにログインするにはパスワードを入力する必要があります
home$ ssh fit@remote_machine
fit@remote_machine's password:
Last login: Fri Apr 15 09:55:34 2016
[email protected]:[/home/fit]
しかし、本当に困惑したのは、自宅のマシンの を にscp
、の を追加したことです。そして、パスワードなしでリモート マシンにログインできます。id_rsa.pub
Alexander@remote_machine
authorized_keys
Alexander@remote_machine
home$ ssh alexander@remote_machine # login without passwd
Last login: Fri Apr 15 09:58:19 2016 from 27.46.137.183
/etc/profile:fc:80: no such event: 1
Alexander@localhost: ~
ありがとう!
答え1
SSHパスワードレス接続が失敗したのは権限が原因でした。権限を変更してください
$ chmod 700 .ssh
$ chmod 600 authorized_keys
今では問題なく動作します。