Use vps2arch as root password if it was not set
This commit is contained in:
parent
57da052692
commit
3dea66516e
1 changed files with 8 additions and 3 deletions
7
vps2arch
7
vps2arch
|
@ -97,8 +97,13 @@ install_packages() {
|
||||||
}
|
}
|
||||||
|
|
||||||
restore_root_pass() {
|
restore_root_pass() {
|
||||||
|
# If the root password is not set, use vps2arch
|
||||||
|
if egrep -q '^root:.?:' "/root.$cpu_type/root.passwd"; then
|
||||||
|
echo "root:vps2arch" | chpasswd
|
||||||
|
else
|
||||||
sed -i '/^root:/d' /etc/shadow
|
sed -i '/^root:/d' /etc/shadow
|
||||||
cat "/root.$cpu_type/root.passwd" >> /etc/shadow
|
cat "/root.$cpu_type/root.passwd" >> /etc/shadow
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
@ -174,7 +179,7 @@ finalize() {
|
||||||
When you are finished with your post-installation, you'll need to reboot the VM the rough way:
|
When you are finished with your post-installation, you'll need to reboot the VM the rough way:
|
||||||
# sync ; reboot -f
|
# sync ; reboot -f
|
||||||
|
|
||||||
Then you'll be able to connect to your VM using SSH and to login using your old root password.
|
Then you'll be able to connect to your VM using SSH and to login using your old root password (or "vps2arch" if you didn't have a root password).
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue