Commit 93663ddf authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Disable root pasword on image

parent 0c627968
...@@ -317,6 +317,10 @@ def slapserver(config): ...@@ -317,6 +317,10 @@ def slapserver(config):
print "Removing %r" % path print "Removing %r" % path
if not dry_run: if not dry_run:
os.remove(path) os.remove(path)
# Disable login by password for root
_call(['passwd','-d','root'])
finally: finally:
print "SlapOS Image configuration: DONE" print "SlapOS Image configuration: DONE"
return 0 return 0
...@@ -554,6 +558,12 @@ def slapprepare(): ...@@ -554,6 +558,12 @@ def slapprepare():
configureNtp() configureNtp()
if not config.update :
print """WARNING: WE WILL DEACTIVATE CONNECTION TO ROOT BY PASSWORD.
If you want to enable it call '# passwd root' an set a new password
We advise you to put your public ssh key in '/root/.ssh/authorized_key'"""
# Enable and run slapos-boot-dedicated.service # Enable and run slapos-boot-dedicated.service
_call(['systemctl','enable','slapos-boot-dedicated.service']) _call(['systemctl','enable','slapos-boot-dedicated.service'])
_call(['systemctl','start','slapos-boot-dedicated.service']) _call(['systemctl','start','slapos-boot-dedicated.service'])
......
...@@ -84,11 +84,6 @@ else ...@@ -84,11 +84,6 @@ else
sed -i "/${SLAPVPN}/ s/^\([^#]\)/#\1/g" $SLAPOS_CONFIGURATION/slapos.cfg sed -i "/${SLAPVPN}/ s/^\([^#]\)/#\1/g" $SLAPOS_CONFIGURATION/slapos.cfg
fi fi
# set random root password
pwgen -sync 512 1 | passwd --stdin root
SLAP_INSTALL_LOG=/opt/slapos/slapos-install.log SLAP_INSTALL_LOG=/opt/slapos/slapos-install.log
while :; do while :; do
......
PermitRootLogin yes PermitRootLogin without-password
AllowUsers root AllowUsers root
AddressFamily any AddressFamily any
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment