diff --git a/test-python-ssh/Readme.md b/test-python-ssh/Readme.md index a085b8d..da129ec 100644 --- a/test-python-ssh/Readme.md +++ b/test-python-ssh/Readme.md @@ -15,7 +15,7 @@ docker run --name pythonsandbox --rm --network-mode host -v ./production_eleves: The directory `data` must contain a `users.txt` containing one username per line, or a `passwords.txt` file, containing `username=password` lines. If you do not provide a password file, it will be generated from user file. The password file is the database from which users/passwords are created in the system. -Additionnaly, you can add a file named `./data/init.sh` which will be executed before starting the servers. It is usefull for debuging or customisation purposes! +Additionnaly, you can add a file named `./data/init.sh` which will be executed (as root) before starting the servers. It is usefull for debuging or customisation purposes! ## Use it You can now ssh into your localhost (and others computer on the same network can ssh into your host). diff --git a/test-python-ssh/data/init.sh b/test-python-ssh/data/init.sh new file mode 100755 index 0000000..51d8400 --- /dev/null +++ b/test-python-ssh/data/init.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo INIIIIT + +# set root passwd +echo -e "root\nroot" | passwd diff --git a/test-python-ssh/data/passwords.txt b/test-python-ssh/data/passwords.txt new file mode 100644 index 0000000..f56c69a --- /dev/null +++ b/test-python-ssh/data/passwords.txt @@ -0,0 +1,2 @@ +218-amine=TPA6eMfztS +218-chems=osjMQQ8rXd diff --git a/test-python-ssh/data/users.txt b/test-python-ssh/data/users.txt new file mode 100644 index 0000000..1179728 --- /dev/null +++ b/test-python-ssh/data/users.txt @@ -0,0 +1,2 @@ +218-amine +218-chems diff --git a/test-python-ssh/entrypoint.sh b/test-python-ssh/entrypoint.sh index dd9aa22..b533600 100755 --- a/test-python-ssh/entrypoint.sh +++ b/test-python-ssh/entrypoint.sh @@ -47,6 +47,10 @@ for line in $(cat $PASSWD_LIST) ; do chown "$name":eleve "$home" done +echo "PermitRootLogin yes" >> /etc/ssh/sshd_config + +echo "\nFin de la préparation des utilisateurs.\n" + # Custom script if [ -f "$CUSTOM_SCRIPT" ] ; then if [ ! -x "$CUSTOM_SCRIPT" ] ; then