2025-06-02 22:13:21 -04: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-08 18:21:10 -04:00
|
|
|
echo -e "vagrant\nvagrant" | sudo passwd root
|
2025-06-02 22:13:21 -04:00
|
|
|
|
|
|
|
|
# unlock the root user
|
2025-06-08 18:21:10 -04:00
|
|
|
sudo passwd -u root
|
2025-06-02 22:13:21 -04:00
|
|
|
|
|
|
|
|
# Enable root SSH login
|
2025-06-08 18:21:10 -04:00
|
|
|
sudo sed -i 's/^#*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
2025-06-02 22:13:21 -04:00
|
|
|
|
2025-06-08 18:21:10 -04:00
|
|
|
sudo systemctl restart sshd
|
2025-06-02 22:13:21 -04:00
|
|
|
|
|
|
|
|
echo "root account setup script done"
|