dont assert user creation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,4 +3,5 @@
|
||||
!/Dockerfile
|
||||
!/.gitignore
|
||||
!/entry.sh
|
||||
!/login.sh
|
||||
!/gen.lua
|
||||
|
||||
2
entry.sh
Normal file → Executable file
2
entry.sh
Normal file → Executable file
@@ -9,4 +9,4 @@ else
|
||||
cp /data/* /etc/ssh/
|
||||
fi
|
||||
|
||||
/usr/sbin/sshd -D -E /dev/stderr 2> /dev/stdout
|
||||
/usr/sbin/sshd -D -E /dev/stderr $@ 2> /dev/stdout
|
||||
|
||||
11
gen.lua
11
gen.lua
@@ -3,6 +3,8 @@ local f = assert(io.open(out, "w"));
|
||||
|
||||
local i = 0;
|
||||
|
||||
f:write("AllowAgentForwarding yes\n");
|
||||
|
||||
for l in io.lines(conf) do
|
||||
i = i + 1;
|
||||
|
||||
@@ -15,15 +17,14 @@ for l in io.lines(conf) do
|
||||
error(conf .. ":" .. i .. ": invalid syntax", 0);
|
||||
end
|
||||
|
||||
assert(os.execute("adduser -Ds /bin/false " .. user));
|
||||
assert(os.execute("passwd -d " .. user));
|
||||
os.execute("adduser -Ds /bin/sh " .. user);
|
||||
os.execute("passwd -d " .. user);
|
||||
|
||||
f:write("Match User ", user);
|
||||
f:write("\n\tForceCommand ssh -o StrictHostKeyChecking=no -A ", params);
|
||||
f:write("\n\tForceCommand ssh-agent ssh -o StrictHostKeyChecking=no ", params, " $SSH_ORIGINAL_COMMAND");
|
||||
f:write("\n\tPubkeyAuthentication yes");
|
||||
f:write("\n\tPasswordAuthentication yes");
|
||||
f:write("\n\tPermitEmptyPasswords yes");
|
||||
f:write("\n\tAllowAgentForwarding yes\n");
|
||||
f:write("\n\tPermitEmptyPasswords yes\n");
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user