正直自分用メモです、あしからず。
やりたいこと
vagrant ssh
ではなく、
ssh username@hostname #要は、公開鍵認証
みたく、ログインできるようにしたく。。。
※ログインユーザーは事前にvm側で作成してあるものとする
手順
ホストマシン作業
$ vagrant up
$ vagrant ssh-config --host hostname # ssh接続情報表示
Host hostname
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile
$ vagrant ssh-config --host hostname >> ~/.ssh/config # confに設定
$ ssh username@hostname #sshログイン
username@hostname's password:
Last login: Sat Jul 25 20:37:08 2015 from 192.168.33.1
[username@hostname ~]$