hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.19k stars 4.43k forks source link

Vagrant ssh asks password however able to login using usual ssh command #6243

Closed coolbrg closed 8 years ago

coolbrg commented 9 years ago

Hi Folks,

I am having a weird issue of "Vagrant ssh prompt password". I searched above and tried those solutions which normally didn't work in my case.

My issue is: vagrant ssh asks password.

However, ssh using following command: ssh vagrant@127.0.0.1 -p 2222 works fine.

But ssh vagrant@127.0.0.1 again asks password.

With this what I understand is my port configuration has messed up.

My vagrant ssh-config show:

$ vagrant ssh-config
Host aquarium
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /home/budhram/vertis/atlantis-project/repos/atlantis-aquarium/vagrant-id_rsa
  IdentitiesOnly yes
  LogLevel FATAL

Any idea what might be wrong here?

sethvargo commented 9 years ago

Hi @budhrg

Can you please share your Vagrantfile?

coolbrg commented 9 years ago

https://github.com/ooyala/atlantis-aquarium/blob/stabilize/Vagrantfile


hostname = "atlantis-aquarium-vm"
domain   = "local"

Vagrant.configure("2") do |config|
  config.ssh.private_key_path = "./vagrant-id_rsa"
  config.vm.define "aquarium" do |aquarium|
    #aquarium.vm.box = ENV["ATLANTIS_VM_BOX"] || "atlantis"
    #aquarium.vm.box_url = "/tmp/atlantis-aquarium.box"
    aquarium.vm.box = "ghao/atlantis-aquarium"

    aquarium.vm.hostname = [hostname,domain].join('.')
    aquarium.vm.provider "virtualbox" do |v|
      v.customize ["modifyvm", :id, "--memory", 2048]
      v.customize ["modifyvm", :id, "--cpus", 4]
    end

    # Mounts for Atlantis
    #aquarium.vm.synced_folder (ENV['ATLANTIS_REPO_ROOT'] || "#{ENV['HOME']}/repos"), "/home/vagrant/repos"
    aquarium.vm.synced_folder "#{ENV['HOME']}/repos", "/home/vagrant/repos"

    # Caching
    aquarium.vm.synced_folder "http-cache", "/var/spool/squid3", :owner => "proxy", :group => "proxy"

    # Convenience for storing data across restarts
    aquarium.vm.synced_folder "data", "/home/vagrant/data"

    # Allow controller to be run inside VM
    # TODO(edanaher): This should be done by installing the gem in the VM
    aquarium.vm.synced_folder "bin", "/home/vagrant/bin"
    aquarium.vm.synced_folder "lib", "/home/vagrant/lib"

    # Forward some useful Atlantis ports for convenience
    aquarium.vm.network "forwarded_port", guest: 443, host: 20443
    aquarium.vm.network "forwarded_port", guest: 8000, host: 28000
    aquarium.vm.network "forwarded_port", guest: 8080, host: 28080
    aquarium.vm.network "forwarded_port", guest: 8081, host: 28081
  end
end
sethvargo commented 9 years ago

Hi @budhrg

This looks to be a problem with the box. Can you try one of the recommended boxes like hashicorp/precise64 or bento/ubuntu-14.04 and see if the issue persists there? Unfortunately I do not have access to your box to play with it locally.

sethvargo commented 8 years ago

Hi @budhrg,

Were you able to try a different box (such as hashicorp/precise64) and see if that resolves the issue?

mitchellh commented 8 years ago

Closing due to lack of response. Sorry! Please reopen a new issue if you have a response to the above.