Browse Source

Client configuration command

Bob Mottram 10 years ago
parent
commit
e15f27b722
5 changed files with 21 additions and 13 deletions
  1. 2
    0
      Makefile
  2. 1
    0
      debian.sh
  3. 1
    0
      debian/source/include-binaries
  4. BIN
      man/freedombone-client.1.gz
  5. 17
    13
      src/freedombone

+ 2
- 0
Makefile View File

@@ -17,10 +17,12 @@ install:
17 17
 	install -m 644 man/${APP}.1.gz ${DESTDIR}${PREFIX}/share/man/man1
18 18
 	install -m 644 man/${APP}-prep.1.gz ${DESTDIR}${PREFIX}/share/man/man1
19 19
 	install -m 644 man/${APP}-tordongle.1.gz ${DESTDIR}${PREFIX}/share/man/man1
20
+	install -m 644 man/${APP}-client.1.gz ${DESTDIR}${PREFIX}/share/man/man1
20 21
 uninstall:
21 22
 	rm -f ${PREFIX}/share/man/man1/${APP}.1.gz
22 23
 	rm -f ${PREFIX}/share/man/man1/${APP}-prep.1.gz
23 24
 	rm -f ${PREFIX}/share/man/man1/${APP}-tordongle.1.gz
25
+	rm -f ${PREFIX}/share/man/man1/${APP}-client.1.gz
24 26
 	rm -rf ${PREFIX}/share/${APP}
25 27
 	rm -f ${PREFIX}/bin/${APP}
26 28
 	rm -f ${PREFIX}/bin/${APP}-prep

+ 1
- 0
debian.sh View File

@@ -11,6 +11,7 @@ sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile
11 11
 sed -i 's/VERSION="'${PREV_VERSION}'"/VERSION="'${VERSION}'"/g' src/freedombone
12 12
 sed -i 's/VERSION="'${PREV_VERSION}'"/VERSION="'${VERSION}'"/g' src/freedombone-prep
13 13
 sed -i 's/VERSION="'${PREV_VERSION}'"/VERSION="'${VERSION}'"/g' src/freedombone-tordongle
14
+sed -i 's/VERSION="'${PREV_VERSION}'"/VERSION="'${VERSION}'"/g' src/freedombone-client
14 15
 
15 16
 # change the parent directory name to debian format
16 17
 mv ../${APP} ../${DIR}

+ 1
- 0
debian/source/include-binaries View File

@@ -1,3 +1,4 @@
1 1
 man/freedombone.1.gz
2 2
 man/freedombone-prep.1.gz
3 3
 man/freedombone-tordongle.1.gz
4
+man/freedombone-client.1.gz

BIN
man/freedombone-client.1.gz View File


+ 17
- 13
src/freedombone View File

@@ -4260,10 +4260,6 @@ function configure_ssh {
4260 4260
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html
4261 4261
 function ssh_remove_small_moduli {
4262 4262
   awk '$5 > 2000' /etc/ssh/moduli > ~/moduli
4263
-  if [[ $((wc -l ~/moduli | awk -F ' ' '{print $1}')) < 150 ]]; then
4264
-      echo 'Not enough moduli > 2000'
4265
-      exit 57824
4266
-  fi
4267 4263
   mv ~/moduli /etc/ssh/moduli
4268 4264
 }
4269 4265
 
@@ -4271,24 +4267,32 @@ function configure_ssh_client {
4271 4267
   if grep -Fxq "configure_ssh_client" $COMPLETION_FILE; then
4272 4268
       return
4273 4269
   fi
4274
-  #sed 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
4275
-  #sed 's/#   ChallengeResponseAuthentication.*/   ChallengeResponseAuthentication no/g' /etc/ssh/ssh_config
4276
-  sed "s/#   HostKeyAlgorithms.*/   HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS/g" /etc/ssh/ssh_config
4277
-  sed "s/#   Ciphers.*/   Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
4278
-  sed "s/#   MACs.*/   MACs $SSH_MACS/g" /etc/ssh/ssh_config
4270
+  #sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
4271
+  #sed -i 's/#   ChallengeResponseAuthentication.*/   ChallengeResponseAuthentication no/g' /etc/ssh/ssh_config
4272
+  sed -i "s/#   HostKeyAlgorithms.*/   HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS/g" /etc/ssh/ssh_config
4273
+  sed -i "s/#   Ciphers.*/   Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
4274
+  sed -i "s/#   MACs.*/   MACs $SSH_MACS/g" /etc/ssh/ssh_config
4279 4275
   if ! grep -q "HostKeyAlgorithms" /etc/ssh/ssh_config; then
4280 4276
       echo "   HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS" >> /etc/ssh/ssh_config
4281 4277
   fi
4282
-  sed "s/Ciphers.*/Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
4278
+  sed -i "s/Ciphers.*/Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
4283 4279
   if ! grep -q "Ciphers " /etc/ssh/ssh_config; then
4284 4280
       echo "   Ciphers $SSH_CIPHERS" >> /etc/ssh/ssh_config
4285 4281
   fi
4286
-  sed "s/MACs.*/MACs $SSH_MACS/g" /etc/ssh/ssh_config
4282
+  sed -i "s/MACs.*/MACs $SSH_MACS/g" /etc/ssh/ssh_config
4287 4283
   if ! grep -q "MACs " /etc/ssh/ssh_config; then
4288 4284
       echo "   MACs $SSH_MACS" >> /etc/ssh/ssh_config
4289 4285
   fi
4290
-  ssh-keygen -t ed25519 -o -a 100
4291
-  ssh-keygen -t rsa -b 4096 -o -a 100
4286
+
4287
+  # Create ssh keys
4288
+  if [ ! -f ~/.ssh/id_ed25519 ]; then
4289
+      ssh-keygen -t ed25519 -o -a 100
4290
+  fi
4291
+  if [ ! -f ~/.ssh/id_rsa ]; then
4292
+      ssh-keygen -t rsa -b 4096 -o -a 100
4293
+  fi
4294
+
4295
+  ssh_remove_small_moduli
4292 4296
   echo 'configure_ssh_client' >> $COMPLETION_FILE
4293 4297
 }
4294 4298