Browse code

Fix for user kicked off after login on some hosts

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)

SvenDowideit authored on 2014/09/22 12:32:34
Showing 2 changed files
... ...
@@ -10,6 +10,9 @@ RUN mkdir /var/run/sshd
10 10
 RUN echo 'root:screencast' | chpasswd
11 11
 RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
12 12
 
13
+# SSH login fix. Otherwise user is kicked off after login
14
+RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
15
+
13 16
 ENV NOTVISIBLE "in users profile"
14 17
 RUN echo "export VISIBLE=now" >> /etc/profile
15 18
 
... ...
@@ -22,6 +22,9 @@ quick access to a test container.
22 22
     RUN echo 'root:screencast' | chpasswd
23 23
     RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
24 24
 
25
+    # SSH login fix. Otherwise user is kicked off after login
26
+    RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
27
+
25 28
     ENV NOTVISIBLE "in users profile"
26 29
     RUN echo "export VISIBLE=now" >> /etc/profile
27 30