Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install OpenSSH 7.3 in Ubuntu 16.04
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
$ wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
$ wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
$ wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
$ wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
$ sudo dpkg -i libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
$ sudo dpkg -i libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
$ sudo dpkg -i libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
$ sudo dpkg -i openssh-client_7.3p1-1_amd64.deb
$ ssh -V
OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016
@seglo

This comment has been minimized.

Show comment
Hide comment
@seglo

seglo Dec 20, 2017

Latest OpenSSH client stable as of now: 7.5p1-10

wget https://launchpadlibrarian.net/335526589/openssh-client_7.5p1-10_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i openssh-client_7.5p1-10_amd64.deb
ssh -V

seglo commented Dec 20, 2017

Latest OpenSSH client stable as of now: 7.5p1-10

wget https://launchpadlibrarian.net/335526589/openssh-client_7.5p1-10_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i openssh-client_7.5p1-10_amd64.deb
ssh -V
@cwhsu1984

This comment has been minimized.

Show comment
Hide comment
@cwhsu1984

cwhsu1984 Jan 6, 2018

Thanks, it works! However, for those who wants to use the shiny new Include directive in ssh config, I must warn you that the autocomplete seem to be broken or at least not loading hosts from the included file.

Thanks, it works! However, for those who wants to use the shiny new Include directive in ssh config, I must warn you that the autocomplete seem to be broken or at least not loading hosts from the included file.

@hsanson

This comment has been minimized.

Show comment
Hide comment
@hsanson

hsanson Jan 22, 2018

@cwhsu1984 if you don't mind manually patching your bash-completion installation you can enable autocomplete yourself.

Edit the /usr/share/bash-completion/bash_completion file as sudo and add this function just before a function called _known_hosts_real():

# Helper function to locate ssh included files in configs
# This function look for the "Include" keyword in ssh config files and include
# them recursively adding each result to the config variable
_included_ssh_config_files()
{
    [[ $# -lt 1 ]] && echo "error: $FUNCNAME: missing mandatory argument CONFIG"
    local configfile i f
    configfile=$1
    local included=$( command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}" )
    for i in ${included[@]}; do
        # Check the origin of $configfile to complete relative included paths on included
        # files according to ssh_config(5):
        #  "[...] Files without absolute paths are assumed to be in ~/.ssh if included in a user
        #   configuration file or /etc/ssh if included from the system configuration file.[...]"
        if ! [[ "$i" =~ ^\~.*|^\/.* ]]; then
            if [[ "$configfile" =~ ^\/etc\/ssh.* ]]; then
                i="/etc/ssh/$i"
            else
                i="$HOME/.ssh/$i"
            fi
        fi
        __expand_tilde_by_ref i
        # In case the expanded variable contains multiple paths
        for f in ${i}; do
            if [ -r $f ]; then
                config+=( "$f" )
                # The Included file is processed to look for Included files in itself
                _included_ssh_config_files $f
            fi
        done
    done
} # _included_ssh_config_files()

Then add the following code:

  # "Include" keyword in ssh config files
    for i in "${config[@]}"; do
        _included_ssh_config_files "$i"
    done

Just before a line that looks like:

    # Known hosts files from configs
    if [[ ${#config[@]} -gt 0 ]]; then
        local OIFS=$IFS IFS=$'\n' j
        local -a tmpkh

Source: scop/bash-completion#70

hsanson commented Jan 22, 2018

@cwhsu1984 if you don't mind manually patching your bash-completion installation you can enable autocomplete yourself.

Edit the /usr/share/bash-completion/bash_completion file as sudo and add this function just before a function called _known_hosts_real():

# Helper function to locate ssh included files in configs
# This function look for the "Include" keyword in ssh config files and include
# them recursively adding each result to the config variable
_included_ssh_config_files()
{
    [[ $# -lt 1 ]] && echo "error: $FUNCNAME: missing mandatory argument CONFIG"
    local configfile i f
    configfile=$1
    local included=$( command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}" )
    for i in ${included[@]}; do
        # Check the origin of $configfile to complete relative included paths on included
        # files according to ssh_config(5):
        #  "[...] Files without absolute paths are assumed to be in ~/.ssh if included in a user
        #   configuration file or /etc/ssh if included from the system configuration file.[...]"
        if ! [[ "$i" =~ ^\~.*|^\/.* ]]; then
            if [[ "$configfile" =~ ^\/etc\/ssh.* ]]; then
                i="/etc/ssh/$i"
            else
                i="$HOME/.ssh/$i"
            fi
        fi
        __expand_tilde_by_ref i
        # In case the expanded variable contains multiple paths
        for f in ${i}; do
            if [ -r $f ]; then
                config+=( "$f" )
                # The Included file is processed to look for Included files in itself
                _included_ssh_config_files $f
            fi
        done
    done
} # _included_ssh_config_files()

Then add the following code:

  # "Include" keyword in ssh config files
    for i in "${config[@]}"; do
        _included_ssh_config_files "$i"
    done

Just before a line that looks like:

    # Known hosts files from configs
    if [[ ${#config[@]} -gt 0 ]]; then
        local OIFS=$IFS IFS=$'\n' j
        local -a tmpkh

Source: scop/bash-completion#70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment