A tramp asks for a password only for the first time "wandering up"

I made my own roaming box for CentOS 6.6. My question is why the tramp always requires a password when I "wander" only for the first time. Here is the console log:

$ vagrant up Bringing machine 'ns' up with 'virtualbox' provider... ==> ns: Clearing any previously set forwarded ports... ==> ns: Clearing any previously set network interfaces... ==> ns: Preparing network interfaces based on configuration... ns: Adapter 1: nat ns: Adapter 2: hostonly ==> ns: Forwarding ports... ns: 22 => 2222 (adapter 1) ==> ns: Running 'pre-boot' VM customizations... ==> ns: Booting VM... ==> ns: Waiting for machine to boot. This may take a few minutes... ns: SSH address: 127.0.0.1:2222 ns: SSH username: vagrant ns: SSH auth method: private key ns: Warning: Connection timeout. Retrying... ns: Warning: Connection timeout. Retrying... ns: Warning: Remote connection disconnect. Retrying... Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text. vagrant@127.0.0.1 password: 

As you can see, the tramp asks for a password. It continues after input. After that, the tramp never asks about it when I make a β€œtramp”. This only happens the first time "wandering up." I am wondering if something from my custom mailbox parameter, maybe ssh, is wrong, but I don’t understand where the problem is.

Can anyone guess the possible reasons?

Environment: the tramp version is 1.7.2. The host OS is ubuntu 15.04, and the guest OS is CentOS 6.6.

+5
source share
3 answers

Vagrant asks for a password when it cannot log in automatically. The most obvious reason is that Vagrant does not have the required user key for the roaming user. Then your entering the correct password and the tramp exchanges the key. Subsequently, it no longer appears. This key exchange is a single instance manager, so if you destroy / delete the instance, and then next time ask for manual login again.

Vagrant offers an unsafe key on Github, and any common available affordable Vagrant box is packaged with it. You can put this key by executing it inside the machine:

 wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys 

Another way is to use your own private key and configure Vagrantfile to use a specific key: Vagrant SSH Config

The tramp himself will immediately recognize and exchange an insecure key and exchange it for a secure one. Therefore, you need to install this key with Hashicorp Packer .

+2
source

You can also try the default stray password: vagrant .

+3
source

I entered the password "tramp" when it happened to me and hit right. See this Vagrant Github issue . Also see this stackoverflow question .

0
source

All Articles