Commit 271e11f4 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

sync-users ampl

parent 01509dad
......@@ -9,13 +9,12 @@ add \
src/xpress.linux-intel64.20191230.tgz \
/opt/ampl/
run apt-get -y update && apt-get install -y openssh-server iproute2 vim
run apt-get -y update && apt-get install -y openssh-server iproute2 inotify-tools
expose 22
run ssh-keygen -A && mkdir -p /run/sshd
cmd /sbin/sshd -D
run echo 'PATH=/opt/ampl:${PATH}' > /etc/profile.d/02-ampl.sh
run echo 'MGR_IP = 130.104.5.17' > /opt/ampl/ampl.lic
run chgrp users /opt/ampl && chmod g+w /opt/ampl
run ln -sf /home/shadow /etc/shadow
run ln -sf /home/passwd /etc/passwd
add sync-users.sh /usr/local/sbin/sync-users.sh
cmd /usr/local/sbin/sync-users.sh & /sbin/sshd -D
# to create a user inside the docker, run useradd -ms /bin/bash -g users username
......@@ -2,6 +2,7 @@ version : "3.7"
services :
ampl:
build: .
image: ampl:v0.1
ports:
- "2022:22"
......@@ -10,9 +11,4 @@ services :
volumes :
home:
# it is necessary to copy password and shadow before first run :
# (this reset all the users and passwd)
# docker-compose up --no-start
# docker cp home/passwd ampl_ampl_1:/home/
# docker cp home/shadow ampl_ampl_1:/home/
# docker-compose up
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:104:105::/nonexistent:/usr/sbin/nologin
sshd:x:105:65534::/run/sshd:/usr/sbin/nologin
root:*:18276:0:99999:7:::
daemon:*:18276:0:99999:7:::
bin:*:18276:0:99999:7:::
sys:*:18276:0:99999:7:::
sync:*:18276:0:99999:7:::
games:*:18276:0:99999:7:::
man:*:18276:0:99999:7:::
lp:*:18276:0:99999:7:::
mail:*:18276:0:99999:7:::
news:*:18276:0:99999:7:::
uucp:*:18276:0:99999:7:::
proxy:*:18276:0:99999:7:::
www-data:*:18276:0:99999:7:::
backup:*:18276:0:99999:7:::
list:*:18276:0:99999:7:::
irc:*:18276:0:99999:7:::
gnats:*:18276:0:99999:7:::
nobody:*:18276:0:99999:7:::
_apt:*:18276:0:99999:7:::
systemd-timesync:*:18323:0:99999:7:::
systemd-network:*:18323:0:99999:7:::
systemd-resolve:*:18323:0:99999:7:::
messagebus:*:18323:0:99999:7:::
sshd:*:18323:0:99999:7:::
if [ -e /home/passwd ]; then
cp /home/passwd /etc/passwd
else
cp /etc/passwd /home/passwd
fi
if [ -e /home/shadow ]; then
cp /home/shadow /etc/shadow
else
cp /etc/shadow /home/shadow
fi
while true; do
inotifywait -e modify /etc/passwd /etc/shadow
cp /etc/passwd /home/passwd
cp /etc/shadow /home/shadow
done
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