Wurde soeben geändert und funktioniert tadellos.
http://imagr.eu/up/0GZ3x_Bilds…016-08-25_um_20.26.56.png
http://imagr.eu/up/qCEOF_Bilds…016-08-25_um_20.27.40.png
http://imagr.eu/up/FBrm5_Bilds…016-08-25_um_20.28.08.png
Code
local orig_addUser = LC.users.addUser
function LC.users.addUser(user, group, home, shell)
local rc, status = orig_addUser(user, group, home, shell)
if rc then
local ema = "/path/to/script.sh " .. user .. " " .. home
LC.log.print(LC.log.INFO, "Adding .ssh folder and authorized_keys file for user ", user)
local emaoutput = LC.exec(ema)
end
return rc, status
end
Alles anzeigen
Bash
#!/bin/bash
user="${1}"
home="${2}"
mkdir -p ${home}/.ssh/
echo '# place your ssh keys here' > ${home}/.ssh/authorized_keys
chown -R ${user}:${user} ${home}/.ssh/
PS: Nicht vergessen dem Shell Script executable Rechte zu geben. (chmod +x script.sh)
Mit freundlichen Grüßen,
Alex