Fixed bug with ssh and remote X11
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 10 Jun 2013 02:28:46 +0000 (22:28 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 10 Jun 2013 02:29:20 +0000 (22:29 -0400)
stage3/pkg/openssh

index 726639d..58707ce 100644 (file)
@@ -21,10 +21,13 @@ hvconfig_pre()
 hvbuild_post()
 {
     # Disabling root logins
-    sed -i -e "s!^#PermitRootLogin.*!PermitRootLogin no!g" /etc/ssh/sshd_config
+    sed -i -e "s!^#\(PermitRootLogin\).*!\1 no!g" /etc/ssh/sshd_config
 
     # Enabling X11 forwarding
-    sed -i -e "s!^#X11Forwarding.*!X11Forwarding yes!g" /etc/ssh/sshd_config
+    echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
+    sed -i -e "s!^#\(X11Forwarding\).*!\1 yes!g" /etc/ssh/sshd_config
+    sed -i -e "s!^#\(ForwardAgent\).*!\1 yes!g" /etc/ssh/ssh_config
+    sed -i -e "s!^#\(ForwardX11\).*!\1 yes!g" /etc/ssh/ssh_config
 
     # Setting MaxAuthTries to 2
     sed -i -e "s!^[#]*MaxAuthTries.*!MaxAuthTries 3!g" /etc/ssh/sshd_config