File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,11 @@ setup_initfence() {
108108
109109update_confconsole_services () {
110110 info $FUNCNAME $@
111- username=$1
111+ new_uname=$1
112+ old_uname=$2
112113 cfg=" /etc/confconsole/services.txt"
113114 [ -e $cfg ] || return 0
114- sed -i " s|\S* @|${username } @|g" $cfg
115+ sed -i " s|${old_uname} @|${new_uname } @|g" $cfg
115116}
116117
117118ssh_authorizedkeys_inithook () {
@@ -222,7 +223,7 @@ case $1 in
222223 passwordless_sudo " admin" ;
223224 inithooks_sudoadmin " true" ;
224225 setup_initfence " admin" ;
225- update_confconsole_services " admin" ;
226+ update_confconsole_services " admin" " root " ;
226227 ssh_authorizedkeys_inithook " admin" ;
227228 ssh_authorizedkeys_merge " admin" " root" ;
228229 user_state " admin" " unlock" ;
@@ -238,7 +239,7 @@ case $1 in
238239 [ " $( id -u) " != " 0" ] && fatal " must be run with root permissions"
239240 inithooks_sudoadmin " false" ;
240241 setup_initfence " root" ;
241- update_confconsole_services " root" ;
242+ update_confconsole_services " root" " admin " ;
242243 ssh_authorizedkeys_inithook " root" ;
243244 ssh_authorizedkeys_merge " root" " admin" ;
244245 permitrootlogin_ssh " yes" ;
You can’t perform that action at this time.
0 commit comments