0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vagrant ssh以外でのSSH接続方法とフォルダ同期の個人的な設定

0
Last updated at Posted at 2019-01-24

環境はこちら
*Vagrant-CentOS/7
*Windows10

$ vagrant ssh以外でSSH接続

Rloginだけできた
方法は2通り

  1. ssh-configで出てきたHostName:127.0.0.1 Port:2222
  2. 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"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?