Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
90d317ce
Commit
90d317ce
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Comment out monkeysphere until enabled on server
parent
5be82ed4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-client
+93
-92
93 additions, 92 deletions
src/freedombone-client
with
93 additions
and
92 deletions
src/freedombone-client
+
93
−
92
View file @
90d317ce
...
...
@@ -40,11 +40,11 @@ VERSION="1.01"
# get the main project file, so that some values can be extracted
MAIN_PROJECT_FILE
=
/usr/local/bin/
${
PROJECT_NAME
}
if
[
!
-f
$MAIN_PROJECT_FILE
]
;
then
MAIN_PROJECT_FILE
=
/usr/bin/
${
PROJECT_NAME
}
MAIN_PROJECT_FILE
=
/usr/bin/
${
PROJECT_NAME
}
fi
if
[
!
-f
$MAIN_PROJECT_FILE
]
;
then
echo
"The main project file
$MAIN_PROJECT_FILE
was not found"
exit
72529
echo
"The main project file
$MAIN_PROJECT_FILE
was not found"
exit
72529
fi
# ssh (from https://stribika.github.io/2015/01/04/secure-secure-shell.html)
...
...
@@ -55,114 +55,115 @@ SSH_HOST_KEY_ALGORITHMS=$(cat $MAIN_PROJECT_FILE | grep 'SSH_HOST_KEY_ALGORITHMS
# see https://stribika.github.io/2015/01/04/secure-secure-shell.html
function
ssh_remove_small_moduli
{
sudo awk
'$5 > 2000'
/etc/ssh/moduli
>
/home/
$CURR_USER
/moduli
sudo mv
/home/
$CURR_USER
/moduli /etc/ssh/moduli
sudo awk
'$5 > 2000'
/etc/ssh/moduli
>
/home/
$CURR_USER
/moduli
sudo mv
/home/
$CURR_USER
/moduli /etc/ssh/moduli
}
function
configure_ssh_client
{
#sudo sed -i 's/# PasswordAuthentication.*/ PasswordAuthentication no/g' /etc/ssh/ssh_config
#sudo sed -i 's/# ChallengeResponseAuthentication.*/ ChallengeResponseAuthentication no/g' /etc/ssh/ssh_config
sudo sed
-i
"s/# HostKeyAlgorithms.*/ HostKeyAlgorithms
$SSH_HOST_KEY_ALGORITHMS
/g"
/etc/ssh/ssh_config
sudo sed
-i
"s/# Ciphers.*/ Ciphers
$SSH_CIPHERS
/g"
/etc/ssh/ssh_config
sudo sed
-i
"s/# MACs.*/ MACs
$SSH_MACS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"HostKeyAlgorithms"
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" HostKeyAlgorithms
$SSH_HOST_KEY_ALGORITHMS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
sudo sed
-i
"s/Ciphers.*/Ciphers
$SSH_CIPHERS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"Ciphers "
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" Ciphers
$SSH_CIPHERS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
sudo sed
-i
"s/MACs.*/MACs
$SSH_MACS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"MACs "
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" MACs
$SSH_MACS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
# Create ssh keys
if
[
!
-f
/home/
$CURR_USER
/.ssh/id_ed25519
]
;
then
ssh-keygen
-t
ed25519
-o
-a
100
fi
if
[
!
-f
/home/
$CURR_USER
/.ssh/id_rsa
]
;
then
ssh-keygen
-t
rsa
-b
4096
-o
-a
100
fi
ssh_remove_small_moduli
if
[
!
-d
~/.ssh
]
;
then
mkdir
~/.ssh
fi
echo
'Host *.onion'
>
~/.ssh/config
echo
' ServerAliveInterval 60'
>>
~/.ssh/config
echo
' ServerAliveCountMax 3'
>>
~/.ssh/config
echo
" ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'"
>>
~/.ssh/config
echo
'Host *'
>>
~/.ssh/config
echo
' ServerAliveInterval 60'
>>
~/.ssh/config
echo
' ServerAliveCountMax 3'
>>
~/.ssh/config
echo
' ProxyCommand monkeysphere ssh-proxycommand %h %p'
>>
~/.ssh/config
echo
''
echo
$'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
echo
''
echo
$(
cat
/home/
$CURR_USER
/.ssh/id_rsa.pub
)
echo
$(
cat
/home/
$CURR_USER
/.ssh/id_ed25519.pub
)
echo
''
#sudo sed -i 's/# PasswordAuthentication.*/ PasswordAuthentication no/g' /etc/ssh/ssh_config
#sudo sed -i 's/# ChallengeResponseAuthentication.*/ ChallengeResponseAuthentication no/g' /etc/ssh/ssh_config
sudo sed
-i
"s/# HostKeyAlgorithms.*/ HostKeyAlgorithms
$SSH_HOST_KEY_ALGORITHMS
/g"
/etc/ssh/ssh_config
sudo sed
-i
"s/# Ciphers.*/ Ciphers
$SSH_CIPHERS
/g"
/etc/ssh/ssh_config
sudo sed
-i
"s/# MACs.*/ MACs
$SSH_MACS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"HostKeyAlgorithms"
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" HostKeyAlgorithms
$SSH_HOST_KEY_ALGORITHMS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
sudo sed
-i
"s/Ciphers.*/Ciphers
$SSH_CIPHERS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"Ciphers "
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" Ciphers
$SSH_CIPHERS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
sudo sed
-i
"s/MACs.*/MACs
$SSH_MACS
/g"
/etc/ssh/ssh_config
if
!
grep
-q
"MACs "
/etc/ssh/ssh_config
;
then
sudo cp
/etc/ssh/ssh_config ~/ssh_config
sudo chown
$CURR_USER
:
$CURR_USER
~/ssh_config
echo
" MACs
$SSH_MACS
"
>>
~/ssh_config
sudo mv
~/ssh_config /etc/ssh/ssh_config
sudo chown
root:root /etc/ssh/ssh_config
fi
# Create ssh keys
if
[
!
-f
/home/
$CURR_USER
/.ssh/id_ed25519
]
;
then
ssh-keygen
-t
ed25519
-o
-a
100
fi
if
[
!
-f
/home/
$CURR_USER
/.ssh/id_rsa
]
;
then
ssh-keygen
-t
rsa
-b
4096
-o
-a
100
fi
ssh_remove_small_moduli
if
[
!
-d
~/.ssh
]
;
then
mkdir
~/.ssh
fi
echo
'Host *.onion'
>
~/.ssh/config
echo
' ServerAliveInterval 60'
>>
~/.ssh/config
echo
' ServerAliveCountMax 3'
>>
~/.ssh/config
echo
" ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p"
>>
~/.ssh/config
echo
"# ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'"
>>
~/.ssh/config
echo
'Host *'
>>
~/.ssh/config
echo
' ServerAliveInterval 60'
>>
~/.ssh/config
echo
' ServerAliveCountMax 3'
>>
~/.ssh/config
echo
'# ProxyCommand monkeysphere ssh-proxycommand %h %p'
>>
~/.ssh/config
echo
''
echo
$'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
echo
''
echo
$(
cat
/home/
$CURR_USER
/.ssh/id_rsa.pub
)
echo
$(
cat
/home/
$CURR_USER
/.ssh/id_ed25519.pub
)
echo
''
}
function
configure_monkeysphere
{
sudo
apt-get
-y
install
tor connect-proxy monkeysphere
sudo
apt-get
-y
install
tor connect-proxy monkeysphere
}
function
show_help
{
echo
''
echo
$"
${
PROJECT_NAME
}
-client --mesh [yes|no]"
echo
''
exit
0
echo
''
echo
$"
${
PROJECT_NAME
}
-client --mesh [yes|no]"
echo
''
exit
0
}
while
[[
$#
>
1
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
show_help
;;
--essid
)
shift
WIFI_SSID
=
"
$1
"
;;
--channel
)
shift
WIFI_CHANNEL
=
${
1
}
;;
--mesh
)
shift
MESH_CLIENT_INSTALL
=
${
1
}
;;
*
)
# unknown option
;;
esac
shift
key
=
"
$1
"
case
$key
in
-h
|
--help
)
show_help
;;
--essid
)
shift
WIFI_SSID
=
"
$1
"
;;
--channel
)
shift
WIFI_CHANNEL
=
${
1
}
;;
--mesh
)
shift
MESH_CLIENT_INSTALL
=
${
1
}
;;
*
)
# unknown option
;;
esac
shift
done
echo
$'Configuring client'
configure_ssh_client
configure_monkeysphere
if
[[
$MESH_CLIENT_INSTALL
==
$'yes'
||
$MESH_CLIENT_INSTALL
==
$'y'
||
$MESH_CLIENT_INSTALL
==
$'on'
]]
;
then
${
PROJECT_NAME
}
-mesh-install
batman_client
${
PROJECT_NAME
}
-mesh-install
babel_client
${
PROJECT_NAME
}
-mesh-install
batman_client
${
PROJECT_NAME
}
-mesh-install
babel_client
fi
echo
$'Configuration complete'
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment