-
-
Save leafsummer/6e39f2b38da708ec25e2e59692c2c5cd to your computer and use it in GitHub Desktop.
vagrant ssh重置
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
默认vagrant私钥路径: | |
%userprofile%\.vagrant.d\insecure_private_key | |
当vagrant探测到是默认公钥时,vagrant up时会自动生成一个新的ssh key: | |
查看vagrant私钥路径: | |
λ vagrant ssh-config | |
Host default | |
HostName 127.0.0.1 | |
User vagrant | |
Port 2222 | |
UserKnownHostsFile /dev/null | |
StrictHostKeyChecking no | |
PasswordAuthentication no | |
IdentityFile d:/vagrant_dev/.vagrant/machines/default/virtualbox/private_key | |
IdentitiesOnly yes | |
LogLevel FATAL | |
手工替换ssh key方法,要注意权限: | |
mkdir -p /home/vagrant/.ssh | |
wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys | |
chmod 0700 /home/vagrant/.ssh | |
chmod 0600 /home/vagrant/.ssh/authorized_keys | |
chown -R vagrant /home/vagrant/.ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment