diff --git a/man/freedombone-image.1.gz b/man/freedombone-image.1.gz index c26f15b8..a4438262 100644 Binary files a/man/freedombone-image.1.gz and b/man/freedombone-image.1.gz differ diff --git a/src/freedombone-image b/src/freedombone-image index fe5fe796..4ff9030a 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -79,6 +79,9 @@ GENERIC_IMAGE="yes" # Whether to reduce the number of decisions during interactive install MINIMAL_INSTALL="yes" +# default SSH port +SSH_PORT=2222 + while [[ $# > 1 ]] do key="$1" @@ -152,6 +155,10 @@ case $key in shift MINIMAL_INSTALL="$1" ;; + --ssh|--sshport) + shift + SSH_PORT="$1" + ;; *) # unknown option ;; @@ -218,7 +225,8 @@ make $IMAGE_TYPE \ IMAGE_SIZE="$IMAGE_SIZE" \ SSH_PUBKEY="$SSH_PUBKEY" \ GENERIC_IMAGE="$GENERIC_IMAGE" \ - MINIMAL_INSTALL="$MINIMAL_INSTALL" + MINIMAL_INSTALL="$MINIMAL_INSTALL" \ + SSH_PORT="$SSH_PORT" if [ ! "$?" = "0" ]; then echo $'Build failed' @@ -262,7 +270,7 @@ Image was created. You will be able to log into it with: " if [[ $IMAGE_TYPE != "virtualbox"* && $IMAGE_TYPE != "qemu"* ]]; then - echo $" ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222 + echo $" ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p $SSH_PORT Password: $PASSWORD " diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index a1bdf69d..37c7c850 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -62,6 +62,9 @@ SSH_PUBKEY="no" # Whether this is a generic image for mass redistribution on the interwebs GENERIC_IMAGE="no" +# default SSH port +SSH_PORT=2222 + enable_eatmydata_override() { chroot $rootdir apt-get install --no-install-recommends -y eatmydata if [ -x $rootdir/usr/bin/eatmydata ] && \ @@ -176,7 +179,7 @@ following commands, then enter your details. } configure_ssh() { - sed -i "s/Port .*/Port 2222/g" $rootdir/etc/ssh/sshd_config + sed -i "s/Port .*/Port ${SSH_PORT}/g" $rootdir/etc/ssh/sshd_config if [[ "$SSH_PUBKEY" != "no" ]]; then if [ ! -d $rootdir/home/$MY_USERNAME/.ssh ]; then diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 09852ae9..f07faa4d 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -52,6 +52,7 @@ export CONFIG_FILENAME export SSH_PUBKEY export GENERIC_IMAGE export MINIMAL_INSTALL +export SSH_PORT # Locate vmdebootstrap program fetched in Makefile basedir=`pwd` @@ -164,6 +165,7 @@ sudo sed -i "s|CONFIG_FILENAME=.*|CONFIG_FILENAME=${CONFIG_FILENAME}|g" $TEMP_CU sudo sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE sudo sed -i "s|GENERIC_IMAGE=.*|GENERIC_IMAGE=${GENERIC_IMAGE}|g" $TEMP_CUSTOMISE sudo sed -i "s|MINIMAL_INSTALL=.*|MINIMAL_INSTALL=\"${MINIMAL_INSTALL}\"|g" $TEMP_CUSTOMISE +sudo sed -i "s|SSH_PORT=.*|SSH_PORT=\"${SSH_PORT}\"|g" $TEMP_CUSTOMISE echo $"starting $VMDEBOOTSTRAP" # Run vmdebootstrap script to create image