SSH鍵交換メモ ssh-copy-id使う

// 鍵生成
$ ssh-keygen -t dsa -N '' -f ~/.ssh/id_dsa
$ ls .ssh/
id_rsa  id_rsa.pub

// リモートマシンに登録
$ ssh-copy-id -i ~/.ssh/id_dsa.pub ymko@192.168.1.10
26
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
ymko@192.168.1.10's password:
Now try logging into the machine, with "ssh 'ymko@192.168.1.10'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

// 通る!
$ ssh 192.168.1.8 ls .ssh/authorized_keys
.ssh/authorized_keys
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
Permission denied, please try again.
// パスワード認証を許可していないとか、パスワードが間違っているとか。確認。