mirror of
https://github.com/openoms/joininbox.git
synced 2026-08-13 12:33:14 +02:00
qtgui: fix sshd login and X11Forwarding
This commit is contained in:
parent
8a8aefd3f9
commit
efe3e8c65e
2 changed files with 17 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue