Skip to content

Commit

Permalink
ssh: Sync config option lists with OpenSSH 7.5p1, add some value comp…
Browse files Browse the repository at this point in the history
…letions
  • Loading branch information
scop committed Mar 17, 2018
1 parent 655ede3 commit 15abc03
Showing 1 changed file with 50 additions and 22 deletions.
72 changes: 50 additions & 22 deletions completions/ssh
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,32 @@ _ssh_macs()
_ssh_options()
{
compopt -o nospace
COMPREPLY=( $( compgen -S = -W 'AddressFamily BatchMode BindAddress
ChallengeResponseAuthentication CheckHostIP Cipher Ciphers
ClearAllForwardings Compression CompressionLevel ConnectionAttempts
ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward
EnableSSHKeysign EscapeChar ExitOnForwardFailure ForwardAgent
ForwardX11 ForwardX11Timeout ForwardX11Trusted GatewayPorts
GlobalKnownHostsFile GSSAPIAuthentication GSSAPIClientIdentity
GSSAPIDelegateCredentials GSSAPIKeyExchange GSSAPIRenewalForcesRekey
GSSAPIServerIdentity GSSAPITrustDns HashKnownHosts Host
HostbasedAuthentication HostKeyAlgorithms HostKeyAlias HostName
IdentityFile IdentitiesOnly IPQoS KbdInteractiveDevices KexAlgorithms
COMPREPLY=( $( compgen -S = -W 'AddKeysToAgent AddressFamily BatchMode
BindAddress CanonicalDomains CanonicalizeFallbackLocal
CanonicalizeHostname CanonicalizeMaxDots CanonicalizePermittedCNAMEs
CertificateFile ChallengeResponseAuthentication CheckHostIP Cipher
Ciphers ClearAllForwardings Compression CompressionLevel
ConnectionAttempts ConnectTimeout ControlMaster ControlPath
ControlPersist DynamicForward EnableSSHKeysign EscapeChar
ExitOnForwardFailure FingerprintHash ForwardAgent ForwardX11
ForwardX11Timeout ForwardX11Trusted GatewayPorts GlobalKnownHostsFile
GSSAPIAuthentication GSSAPIClientIdentity GSSAPIDelegateCredentials
GSSAPIKeyExchange GSSAPIRenewalForcesRekey GSSAPIServerIdentity
GSSAPITrustDns HashKnownHosts Host HostbasedAuthentication
HostbasedKeyTypes HostKeyAlgorithms HostKeyAlias HostName
IdentitiesOnly IdentityAgent IdentityFile IgnoreUnknown Include IPQoS
KbdInteractiveAuthentication KbdInteractiveDevices KexAlgorithms
LocalCommand LocalForward LogLevel MACs
NoHostAuthenticationForLocalhost NumberOfPasswordPrompts ProxyJump
NoHostAuthenticationForLocalhost NumberOfPasswordPrompts
PasswordAuthentication PermitLocalCommand PKCS11Provider Port
PreferredAuthentications Protocol ProxyCommand PubkeyAuthentication
RekeyLimit RemoteForward RequestTTY RhostsRSAAuthentication
RSAAuthentication SendEnv ServerAliveCountMax ServerAliveInterval
SmartcardDevice StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice
UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS
VisualHostKey XAuthLocation' -- "$cur" ) )
PreferredAuthentications Protocol ProxyCommand ProxyJump ProxyUseFdpass
PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteForward
RequestTTY RevokedHostKeys RhostsRSAAuthentication RSAAuthentication
SendEnv ServerAliveCountMax ServerAliveInterval SmartcardDevice
StreamLocalBindMask StreamLocalBindUnlink StrictHostKeyChecking
TCPKeepAlive Tunnel TunnelDevice UpdateHostKeys UsePrivilegedPort User
UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation' \
-- "$cur" ) )
}

# Complete a ssh suboption (like ForwardAgent=y<tab>)
Expand All @@ -65,31 +71,47 @@ _ssh_suboption()
local prev=${1%%=*} cur=${1#*=}

case $prev in
BatchMode|ChallengeResponseAuthentication|CheckHostIP|\
BatchMode|CanonicalDomains|CanonicalizeFallbackLocal|\
ChallengeResponseAuthentication|CheckHostIP|\
ClearAllForwardings|ControlPersist|Compression|EnableSSHKeysign|\
ExitOnForwardFailure|ForwardAgent|ForwardX11|ForwardX11Trusted|\
GatewayPorts|GSSAPIAuthentication|GSSAPIKeyExchange|\
GSSAPIDelegateCredentials|GSSAPIRenewalForcesRekey|GSSAPITrustDns|\
HashKnownHosts|HostbasedAuthentication|IdentitiesOnly|\
KbdInteractiveAuthentication|KbdInteractiveDevices|\
NoHostAuthenticationForLocalhost|PasswordAuthentication|\
PubkeyAuthentication|RhostsRSAAuthentication|RSAAuthentication|\
StrictHostKeyChecking|TCPKeepAlive|UsePrivilegedPort|\
VerifyHostKeyDNS|VisualHostKey)
ProxyUseFdpass|PubkeyAuthentication|RhostsRSAAuthentication|\
RSAAuthentication|StrictHostKeyChecking|StreamLocalBindUnlink|\
TCPKeepAlive|UsePrivilegedPort|VerifyHostKeyDNS|VisualHostKey)
COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) )
;;
AddKeysToAgent)
COMPREPLY=( $( compgen -W 'yes ask confirm no' -- "$cur" ) )
;;
AddressFamily)
COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) )
;;
BindAddress)
_ip_addresses
;;
CanonicalizeHostname)
COMPREPLY=( $( compgen -W 'yes no always' -- "$cur" ) )
;;
CertificateFile|IdentityAgent|Include)
_filedir
;;
Cipher)
COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) )
;;
Ciphers)
_ssh_ciphers "$2"
;;
CompressionLevel)
COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) )
;;
FingerprintHash)
COMPREPLY=( $( compgen -W 'md5 sha256' -- "$cur" ) )
;;
IPQoS)
COMPREPLY=( $( compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3}
cs{0..7} ef lowdelay throughput reliability' -- "$cur" ) )
Expand All @@ -113,13 +135,19 @@ _ssh_suboption()
ProxyJump)
_known_hosts_real -a -F "$configfile" -- "$cur"
;;
PubkeyAcceptedKeyTypes)
COMPREPLY=( $( compgen -W '$( _ssh_query "$2" key )' -- "$cur" ) )
;;
RequestTTY)
COMPREPLY=( $( compgen -W 'no yes force auto' -- "$cur" ) )
;;
Tunnel)
COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \
-- "$cur" ) )
;;
UpdateHostKeys)
COMPREPLY=( $( compgen -W 'yes no ask' -- "$cur" ) )
;;
esac
return 0
}
Expand Down

0 comments on commit 15abc03

Please sign in to comment.