|
@@ -86,6 +86,7 @@ INSTALLING_FROM_CONFIGURATION_FILE="no"
|
86
|
86
|
CONFIGURATION_FILE="${PROJECT_NAME}.cfg"
|
87
|
87
|
|
88
|
88
|
SSH_PORT=2222
|
|
89
|
+SSH_ONION_PORT=8094
|
89
|
90
|
IRC_PORT=6697
|
90
|
91
|
|
91
|
92
|
# An optional password to log into IRC. This applies to all users
|
|
@@ -3680,6 +3681,40 @@ function configure_ssh {
|
3680
|
3681
|
echo 'configure_ssh' >> $COMPLETION_FILE
|
3681
|
3682
|
}
|
3682
|
3683
|
|
|
3684
|
+function configure_ssh_onion {
|
|
3685
|
+ if grep -Fxq "configure_ssh_onion" $COMPLETION_FILE; then
|
|
3686
|
+ return
|
|
3687
|
+ fi
|
|
3688
|
+ if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
|
3689
|
+ return
|
|
3690
|
+ fi
|
|
3691
|
+
|
|
3692
|
+ if [ ! -d /var/lib/tor ]; then
|
|
3693
|
+ echo $'No Tor installation found. ssh onion domain cannot be configured.'
|
|
3694
|
+ exit 32672
|
|
3695
|
+ fi
|
|
3696
|
+ if ! grep -q "hidden_service_ssh" /etc/tor/torrc; then
|
|
3697
|
+ echo 'HiddenServiceDir /var/lib/tor/hidden_service_ssh/' >> /etc/tor/torrc
|
|
3698
|
+ echo "HiddenServicePort ${SSH_PORT} 127.0.0.1:${SSH_ONION_PORT}" >> /etc/tor/torrc
|
|
3699
|
+ echo $'Added onion domain for ssh'
|
|
3700
|
+ fi
|
|
3701
|
+
|
|
3702
|
+ systemctl restart tor
|
|
3703
|
+
|
|
3704
|
+ if [ ! -f /var/lib/tor/hidden_service_ssh/hostname ]; then
|
|
3705
|
+ echo $'ssh onion domain hostname not found'
|
|
3706
|
+ exit 62983
|
|
3707
|
+ fi
|
|
3708
|
+ SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)
|
|
3709
|
+ if ! grep -q "ssh onion domain" $COMPLETION_FILE; then
|
|
3710
|
+ echo "ssh onion domain:${SSH_ONION_HOSTNAME}" >> $COMPLETION_FILE
|
|
3711
|
+ else
|
|
3712
|
+ sed -i "s|ssh onion domain.*|ssh onion domain:${SSH_ONION_HOSTNAME}|g" $COMPLETION_FILE
|
|
3713
|
+ fi
|
|
3714
|
+
|
|
3715
|
+ echo 'configure_ssh_onion' >> $COMPLETION_FILE
|
|
3716
|
+}
|
|
3717
|
+
|
3683
|
3718
|
# see https://stribika.github.io/2015/01/04/secure-secure-shell.html
|
3684
|
3719
|
function ssh_remove_small_moduli {
|
3685
|
3720
|
awk '$5 > 2000' /etc/ssh/moduli > ~/moduli
|
|
@@ -9712,6 +9747,7 @@ time_synchronisation
|
9712
|
9747
|
configure_internet_protocol
|
9713
|
9748
|
create_git_project
|
9714
|
9749
|
configure_ssh
|
|
9750
|
+configure_ssh_onion
|
9715
|
9751
|
remove_instructions_from_motd
|
9716
|
9752
|
check_hwrng
|
9717
|
9753
|
search_for_attached_usb_drive
|