I'm sure everyone here gets tired of people like me posting questions about 
this error but for some of us, vagrant is terribly difficult to use because 
of SSH.  I've just built a simple Vagrant VM that I need to connect to the 
outside world so that I can install Python packages from pypi.org onto it. 
 When I create it, I have an Ansible provisioner that creates my user 
account 'jones' and then uploads my public key ~/.ssh/id_rsa.pub into 
~/.ssh/authorized_keys on the VM.  The permissions for my remote .ssh 
directory and the authorized keys file are all correct (they are set to the 
same permissions I've used on numerous other real Unix servers I manage). 
 The problem is that no matter why I've tried, when I try to log in, I get 
an error:

ssh [email protected] -vvvv | tee error.txt
Permission denied (publickey).


Here is the Vagrantfile:

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "debian/stretch64"
  config.vm.synced_folder "./shared", "/vagrant", type: "virtualbox"
  config.vm.provider :virtualbox do |v|
    v.memory = 256
    v.linked_clone = true
  end
  ENV['ANSIBLE_ROLES_PATH'] = "/Users/jones/playbooks/roles"


  config.vm.define "fs" do |fs|
    fs.vm.hostname = "fs00.example.com"
    fs.vm.network "public_network", bridge: "en4: Apple USB Ethernet 
Adapter"


    config.vm.provision "ansible" do |ansible|
      ansible.playbook = "provision.yml"
      ansible.compatibility_mode = "2.0"
      ansible.vault_password_file = "vault_pass"
      ansible.become = true
    end
  end
end


Here is my local ~/.ssh/config file:

Host *
  ServerAliveInterval 60
  StrictHostKeyChecking no



This is the output from ssh-config:

Host fs
  HostName 127.0.0.1
  User vagrant
  Port 2204
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/jones/playbooks/swingerpixels-vm/.vagrant/machines/fs/
virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL


I tried to run the ssh command with the "-vvvv" option and then tee the 
output to a file to display here but nothing gets written to the file.

Can anyone see what I'm doing wrong?

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/39ca59d3-1aa8-4d90-85df-17b306712eed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to