Help us understand the problem. What is going on with this article?

vagrant 1.7以降は'vagrant up'した時にinsecure_keyを差し替える

More than 5 years have passed since last update.

vagrantをアップデートしたらゲストにログインできなくなって焦った。
原因はタイトルの通り。

ちゃんと見てなかったけどログにも出てた。

    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...

この機能を無効化したい場合、Vagrantfileで以下を設定する

Vagrantfile
  config.ssh.insert_key = false

ゲストにログインする際にvagrant sshしない(主にWindowsな)人はご注意を。

※参照
https://twitter.com/mitchellh/status/525704126647128064

もう面倒だからRakeからTeraTerm呼び出すtask作った。

Rakefile
desc 'login with TeraTerm SSH'
task :ssh do
  host, port, user, keyfile = nil, nil, nil, nil
  `vagrant ssh-config`.each_line do |l|
    host = l.sub('HostName','').strip if l.strip.match(/^HostName\s/)
    port = l.sub('Port','').strip if l.strip.match(/^Port\s/)
    user = l.sub('User','').strip if l.strip.match(/^User\s/)
    keyfile = l.sub('IdentityFile','').strip if l.strip.match(/^IdentityFile\s/)
  end
  spawn({"PATH" => "C:\\Program Files\\teraterm"}, "ttermpro #{host}:#{port} /ssh /auth=publickey /user=#{user} /keyfile=#{keyfile}")
end
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした