0

I have an ssh config file generated by vagrant ssh that looks like this

Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /<my-working-directory>/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

I have seen elsewhere that you can use C-x C-f /sshx:<ssh config host name> to connect. Mine looks like its named default. However, how do I specify the location of this config file so that tramp can find this "default" ssh config? Im assuming it at least needs to know my Identity file

1 Answer 1

2

Ok so this was due to me not understanding how ssh works. This is the config of the vagrant machine yes. But its for me to put in my own ~/.ssh/config file so that I can ssh into whatever I name it.

so in my ~/.ssh/config I appended it to the existing entries

Host some-other-host
  HostName 43.203.234.33
  User ubuntu
  IdentityFile ~/.ssh/id_rsa
Host vagrant
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /<my-working-dir>/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

and now I can ssh vagrant for instance. OR for tramp: C-x C-f /sshx:vagrant:/home/vagrant/some-file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.