2025-06-03 05:13:21 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Enable root account login
|
|
|
|
|
|
|
|
# If sudo with the default vagrant SSH user is acceptable, then we may not do
|
|
|
|
# this and just update the documentation to use the vagrant user and sudo before
|
|
|
|
# commands.
|
|
|
|
|
|
|
|
# Set the root user password
|
2025-06-09 01:21:10 +03:00
|
|
|
echo -e "vagrant\nvagrant" | sudo passwd root
|
2025-06-03 05:13:21 +03:00
|
|
|
|
|
|
|
# unlock the root user
|
2025-06-09 01:21:10 +03:00
|
|
|
sudo passwd -u root
|
2025-06-03 05:13:21 +03:00
|
|
|
|
|
|
|
# Enable root SSH login
|
2025-06-09 01:21:10 +03:00
|
|
|
sudo sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
2025-06-03 05:13:21 +03:00
|
|
|
|
2025-06-09 01:21:10 +03:00
|
|
|
sudo systemctl restart sshd
|
2025-06-03 05:13:21 +03:00
|
|
|
|
|
|
|
echo "root account setup script done"
|