diff --git a/scripts/info.qtgui.sh b/scripts/info.qtgui.sh index efc049e..8c6d2d5 100755 --- a/scripts/info.qtgui.sh +++ b/scripts/info.qtgui.sh @@ -24,26 +24,26 @@ case $CHOICE in esac joinmarketSSHchanged=0 -if grep -Eq "^joinmarketSSH=off" /home/joinmarket/joinin.conf; then +if grep -Eq "^DenyUsers joinmarket" /etc/ssh/sshd_config; then sudo /home/joinmarket/set.ssh.sh on joinmarketSSHchanged=1 fi +# switch on X11 forwarding +sudo sed -i "s/^X11Forwarding no/X11Forwarding yes/g" /etc/ssh/sshd_config +if ! grep -Eq "^X11Forwarding yes" /etc/ssh/sshd_config; then + echo "X11Forwarding yes" | sudo tee -a /etc/ssh/sshd_config +fi +echo "# Set 'X11Forwarding yes' and restarting sshd" +sudo service sshd restart + + if [ "$RPCoverTor" = "on" ];then tor="torsocks " else tor="" fi -# switch on X11 forwarding -if ! grep -Eq "^X11Forwarding no" /etc/ssh/sshd_config; then - echo "X11Forwarding no" | sudo tee -a /etc/ssh/sshd_config -fi -if sudo sed -i "s/^X11Forwarding no/X11Forwarding yes/g" /etc/ssh/sshd_config;then - echo "# Set 'X11Forwarding yes' and restarting sshd" - sudo service sshd restart -fi - echo " ************************************************************************************ Instructions to open the JoinMarket-QT GUI on the desktop diff --git a/scripts/set.ssh.sh b/scripts/set.ssh.sh index 31187fc..2aee01c 100755 --- a/scripts/set.ssh.sh +++ b/scripts/set.ssh.sh @@ -14,24 +14,24 @@ fi # add default value to config if needed if ! grep -Eq "^joinmarketSSH=" /home/joinmarket/joinin.conf; then - echo "joinmarketSSH=on" >> /home/joinmarket/joinin.conf + echo "joinmarketSSH=on" | tee -a /home/joinmarket/joinin.conf fi echo -if [ $1 = "off" ];then +if [ "$1" = "off" ];then echo "# Disable ssh access with the joinmarket user" if ! grep -Eq "^DenyUsers joinmarket" /etc/ssh/sshd_config; then - echo "DenyUsers joinmarket" >> /etc/ssh/sshd_config + echo "DenyUsers joinmarket" | tee -a /etc/ssh/sshd_config # set value in config - sudo sed -i "s/^joinmarketSSH=.*/joinmarketSSH=off/g" /home/joinmarket/joinin.conf - systemctl restart ssh + sed -i "s/^joinmarketSSH=.*/joinmarketSSH=off/g" /home/joinmarket/joinin.conf + service sshd restart fi -elif [ $1 = "on" ]; then +elif [ "$1" = "on" ]; then echo "# Enable ssh access with the joinmarket user" sed -i "s/^DenyUsers joinmarket//g" /etc/ssh/sshd_config # set value in config sed -i "s/^joinmarketSSH=.*/joinmarketSSH=on/g" /home/joinmarket/joinin.conf - systemctl restart ssh + service sshd restart else echo "# Invalid option $*" exit 1