method one
1. Find your private_key
Second, import it into your Xshell
- Enter your login name:vagrant
- Input secret key
User secret key, import
OK
Three, login successfully
No need to enter any password, login method similar to ssh
login is your vagrant account
Log in as your root user
su root
Type your password (vagrant default password)
Method Two
- Configure root password
- Enter the virtual machine just created
vagrant ssh
- Use command to enter root user
su root
password:vagrant
- Modify sshd_config so that the root user can log in with a password
vi /etc/ssh/sshd_config
- To
PasswordAuthentication yes
Enter passwd
change password
Account: vagrant
Password: vagrant
reboot #重启
login successful
Account: root
Password: vagrant
login successful!!!