Enable ssh via onion

This commit is contained in:
Bob Mottram 2016-01-25 16:35:16 +00:00
parent f6f611a093
commit 93fd202696
1 changed files with 22 additions and 0 deletions

View File

@ -3521,6 +3521,27 @@ function install_tor {
apt-get -y install tor
}
function enable_ssh_via_onion {
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return
fi
apt-get -y install tor connect-proxy
if ! grep -q 'Host *.onion' /home/$MY_USERNAME/.ssh/config; then
if [ ! -f /home/$MY_USERNAME/.ssh ]; then
mkdir /home/$MY_USERNAME/.ssh
fi
echo 'Host *.onion' >> /home/$MY_USERNAME/.ssh/config
echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /home/$MY_USERNAME/.ssh/config
fi
if ! grep -q 'Host *.onion' /root/.ssh/config; then
if [ ! -f /root/.ssh ]; then
mkdir /root/.ssh
fi
echo 'Host *.onion' >> /root/.ssh/config
echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /root/.ssh/config
fi
}
function install_editor {
if grep -Fxq "install_editor" $COMPLETION_FILE; then
return
@ -9860,6 +9881,7 @@ enable_backports
configure_dns
initial_setup
install_tor
enable_ssh_via_onion
check_date
install_dynamicdns
randomize_cron