3 # Set the root password and others
4 # Source functions library
5 .
/etc
/init.d
/functions
6 .
/usr
/libexec
/ovirt-functions
8 trap '__st=$?; stop_log; exit $__st' 0
9 trap 'exit $?' 1 2 13 15
11 warn
() { printf '%s\n' "$*" >&2; }
13 if ! is_local_storage_configured
; then
14 warn
"Local storage must be configured prior to setting the administrator password."
18 # Usage: set_sasl_password USER
19 # Prompt(twice) for a password for the specified USER.
20 # If they match, set that user's system password,
21 # and add USER to the SASL list for libvirt.
22 function set_sasl_password
{
25 printf "\nNode SASL User ($user):\n"
26 saslpasswd2
-a libvirt
"$user"
30 # Prompts the user for a single username, password combo
31 function prompt_sasl_user
{
33 printf "\nPlease enter a new username (hit return to skip) "
35 test -z "$REPLY" && return 1
36 set_sasl_password
"$REPLY"
41 printf "\n\n Password Configuration\n\n"
45 # Set the password for the root user first
46 printf "\nSystem Administrator ($user):\n"
47 unmount_config
/etc
/shadow
49 ovirt_store_config
/etc
/shadow
57 set /files/etc/ssh/sshd_config/PasswordAuthentication ${permit}
59 ovirt_store_config
/etc
/ssh
/sshd_config
64 printf "\nSSH password authentication\n\n"
66 if ask_yes_or_no
"Enable SSH password authentication ([Y]es/[N]o)?"; then
73 PASSWORD
="Set root password"
74 ADMIN_PASSWORD
="Set admin user password"
75 SSH
="Toggle SSH password authentication"
76 QUIT
="Quit and Return To Menu"
78 if [[ "$1" == "AUTO" ]]; then
79 if [ -n "${OVIRT_SSH_PWAUTH}" ]; then
80 toggle_ssh_access
$OVIRT_SSH_PWAUTH
85 /usr
/bin
/augtool get
/files
/etc
/ssh
/sshd_config
/PasswordAuthentication|
grep -q yes$
89 printf "\nSSH password authentication is currently ${state}.\n\n"
91 PS3
="Please select an option: "
92 select option
in "$PASSWORD" "$ADMIN_PASSWORD" "$SSH" "$QUIT"
95 $PASSWORD) set_password
; break;;
96 $ADMIN_PASSWORD) set_password admin
; break;;
97 $SSH) toggle_ssh
; break;;