環境はこちら
*Vagrant-CentOS/7
*Windows10
$ vagrant ssh以外でSSH接続
Rloginだけできた
方法は2通り
- ssh-configで出てきたHostName:127.0.0.1 Port:2222
- Vagrantfileで設定したip:192.168.33.10 Port:22
どちらもユーザー名、パスワードを共にvagrant、SSH認証鍵の設定も忘れずに☜$ vagrant ssh-configで確認しよう
PUTTYはどうしてもできなかった。~~~~あきらめる勇気を手に入れた!
【追記】PUTTYでもSSH認証鍵を設定する必要がありました。
Ubuntuとはここら辺の仕様が違うっぽいですね
RloginとPUTTY以外手を付けてないから他は知らない!!
フォルダ同期でした方がいい設定
vagrantアカウントでログインしたときのディレクトリは/home/vagrantになるから、フォルダの同期にはゲストOSの設定を/home/vagrant/syncとかにしとくと良い。
これでVScodeが使える!(typeを明示的に設定することで双方向での同期ができます)
Vagrantfile
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "./sync", "/home/vagrant/sync",type:"virtualbox"