mirror of https://gitee.com/openkylin/openssh.git
Various Debian-specific configuration changes
ssh: Enable ForwardX11Trusted, returning to earlier semantics which cause fewer problems with existing setups (http://bugs.debian.org/237021). ssh: Set 'SendEnv LANG LC_*' by default (http://bugs.debian.org/264024). ssh: Enable HashKnownHosts by default to try to limit the spread of ssh worms. ssh: Enable GSSAPIAuthentication by default. ssh: Include /etc/ssh/ssh_config.d/*.conf. sshd: Enable PAM, disable ChallengeResponseAuthentication, and disable PrintMotd. sshd: Enable X11Forwarding. sshd: Set 'AcceptEnv LANG LC_*' by default. sshd: Change sftp subsystem path to /usr/lib/openssh/sftp-server. sshd: Include /etc/ssh/sshd_config.d/*.conf. Document all of this. Author: Russ Allbery <rra@debian.org> Forwarded: not-needed Last-Update: 2020-02-21 Patch-Name: debian-config.patch Gbp-Pq: Name debian-config.patch
This commit is contained in:
parent
beb50438f4
commit
f8f63fbd2c
|
@ -2087,7 +2087,7 @@ fill_default_options(Options * options)
|
||||||
if (options->forward_x11 == -1)
|
if (options->forward_x11 == -1)
|
||||||
options->forward_x11 = 0;
|
options->forward_x11 = 0;
|
||||||
if (options->forward_x11_trusted == -1)
|
if (options->forward_x11_trusted == -1)
|
||||||
options->forward_x11_trusted = 0;
|
options->forward_x11_trusted = 1;
|
||||||
if (options->forward_x11_timeout == -1)
|
if (options->forward_x11_timeout == -1)
|
||||||
options->forward_x11_timeout = 1200;
|
options->forward_x11_timeout = 1200;
|
||||||
/*
|
/*
|
||||||
|
|
24
ssh.1
24
ssh.1
|
@ -809,6 +809,16 @@ directive in
|
||||||
.Xr ssh_config 5
|
.Xr ssh_config 5
|
||||||
for more information.
|
for more information.
|
||||||
.Pp
|
.Pp
|
||||||
|
(Debian-specific: X11 forwarding is not subjected to X11 SECURITY extension
|
||||||
|
restrictions by default, because too many programs currently crash in this
|
||||||
|
mode.
|
||||||
|
Set the
|
||||||
|
.Cm ForwardX11Trusted
|
||||||
|
option to
|
||||||
|
.Dq no
|
||||||
|
to restore the upstream behaviour.
|
||||||
|
This may change in future depending on client-side improvements.)
|
||||||
|
.Pp
|
||||||
.It Fl x
|
.It Fl x
|
||||||
Disables X11 forwarding.
|
Disables X11 forwarding.
|
||||||
.Pp
|
.Pp
|
||||||
|
@ -817,6 +827,20 @@ Enables trusted X11 forwarding.
|
||||||
Trusted X11 forwardings are not subjected to the X11 SECURITY extension
|
Trusted X11 forwardings are not subjected to the X11 SECURITY extension
|
||||||
controls.
|
controls.
|
||||||
.Pp
|
.Pp
|
||||||
|
(Debian-specific: In the default configuration, this option is equivalent to
|
||||||
|
.Fl X ,
|
||||||
|
since
|
||||||
|
.Cm ForwardX11Trusted
|
||||||
|
defaults to
|
||||||
|
.Dq yes
|
||||||
|
as described above.
|
||||||
|
Set the
|
||||||
|
.Cm ForwardX11Trusted
|
||||||
|
option to
|
||||||
|
.Dq no
|
||||||
|
to restore the upstream behaviour.
|
||||||
|
This may change in future depending on client-side improvements.)
|
||||||
|
.Pp
|
||||||
.It Fl y
|
.It Fl y
|
||||||
Send log information using the
|
Send log information using the
|
||||||
.Xr syslog 3
|
.Xr syslog 3
|
||||||
|
|
|
@ -17,9 +17,12 @@
|
||||||
# list of available options, their meanings and defaults, please see the
|
# list of available options, their meanings and defaults, please see the
|
||||||
# ssh_config(5) man page.
|
# ssh_config(5) man page.
|
||||||
|
|
||||||
# Host *
|
Include /etc/ssh/ssh_config.d/*.conf
|
||||||
|
|
||||||
|
Host *
|
||||||
# ForwardAgent no
|
# ForwardAgent no
|
||||||
# ForwardX11 no
|
# ForwardX11 no
|
||||||
|
# ForwardX11Trusted yes
|
||||||
# PasswordAuthentication yes
|
# PasswordAuthentication yes
|
||||||
# HostbasedAuthentication no
|
# HostbasedAuthentication no
|
||||||
# GSSAPIAuthentication no
|
# GSSAPIAuthentication no
|
||||||
|
@ -45,3 +48,6 @@
|
||||||
# VisualHostKey no
|
# VisualHostKey no
|
||||||
# ProxyCommand ssh -q -W %h:%p gateway.example.com
|
# ProxyCommand ssh -q -W %h:%p gateway.example.com
|
||||||
# RekeyLimit 1G 1h
|
# RekeyLimit 1G 1h
|
||||||
|
SendEnv LANG LC_*
|
||||||
|
HashKnownHosts yes
|
||||||
|
GSSAPIAuthentication yes
|
||||||
|
|
26
ssh_config.5
26
ssh_config.5
|
@ -71,6 +71,29 @@ Since the first obtained value for each parameter is used, more
|
||||||
host-specific declarations should be given near the beginning of the
|
host-specific declarations should be given near the beginning of the
|
||||||
file, and general defaults at the end.
|
file, and general defaults at the end.
|
||||||
.Pp
|
.Pp
|
||||||
|
Note that the Debian
|
||||||
|
.Ic openssh-client
|
||||||
|
package sets several options as standard in
|
||||||
|
.Pa /etc/ssh/ssh_config
|
||||||
|
which are not the default in
|
||||||
|
.Xr ssh 1 :
|
||||||
|
.Pp
|
||||||
|
.Bl -bullet -offset indent -compact
|
||||||
|
.It
|
||||||
|
.Cm Include /etc/ssh/ssh_config.d/*.conf
|
||||||
|
.It
|
||||||
|
.Cm SendEnv No LANG LC_*
|
||||||
|
.It
|
||||||
|
.Cm HashKnownHosts No yes
|
||||||
|
.It
|
||||||
|
.Cm GSSAPIAuthentication No yes
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
.Pa /etc/ssh/ssh_config.d/*.conf
|
||||||
|
files are included at the start of the system-wide configuration file, so
|
||||||
|
options set there will override those in
|
||||||
|
.Pa /etc/ssh/ssh_config.
|
||||||
|
.Pp
|
||||||
The file contains keyword-argument pairs, one per line.
|
The file contains keyword-argument pairs, one per line.
|
||||||
Lines starting with
|
Lines starting with
|
||||||
.Ql #
|
.Ql #
|
||||||
|
@ -729,11 +752,12 @@ elapsed.
|
||||||
.It Cm ForwardX11Trusted
|
.It Cm ForwardX11Trusted
|
||||||
If this option is set to
|
If this option is set to
|
||||||
.Cm yes ,
|
.Cm yes ,
|
||||||
|
(the Debian-specific default),
|
||||||
remote X11 clients will have full access to the original X11 display.
|
remote X11 clients will have full access to the original X11 display.
|
||||||
.Pp
|
.Pp
|
||||||
If this option is set to
|
If this option is set to
|
||||||
.Cm no
|
.Cm no
|
||||||
(the default),
|
(the upstream default),
|
||||||
remote X11 clients will be considered untrusted and prevented
|
remote X11 clients will be considered untrusted and prevented
|
||||||
from stealing or tampering with data belonging to trusted X11
|
from stealing or tampering with data belonging to trusted X11
|
||||||
clients.
|
clients.
|
||||||
|
|
18
sshd_config
18
sshd_config
|
@ -10,6 +10,8 @@
|
||||||
# possible, but leave them commented. Uncommented options override the
|
# possible, but leave them commented. Uncommented options override the
|
||||||
# default value.
|
# default value.
|
||||||
|
|
||||||
|
Include /etc/ssh/sshd_config.d/*.conf
|
||||||
|
|
||||||
#Port 22
|
#Port 22
|
||||||
#AddressFamily any
|
#AddressFamily any
|
||||||
#ListenAddress 0.0.0.0
|
#ListenAddress 0.0.0.0
|
||||||
|
@ -57,8 +59,9 @@ AuthorizedKeysFile .ssh/authorized_keys
|
||||||
#PasswordAuthentication yes
|
#PasswordAuthentication yes
|
||||||
#PermitEmptyPasswords no
|
#PermitEmptyPasswords no
|
||||||
|
|
||||||
# Change to no to disable s/key passwords
|
# Change to yes to enable challenge-response passwords (beware issues with
|
||||||
#ChallengeResponseAuthentication yes
|
# some PAM modules and threads)
|
||||||
|
ChallengeResponseAuthentication no
|
||||||
|
|
||||||
# Kerberos options
|
# Kerberos options
|
||||||
#KerberosAuthentication no
|
#KerberosAuthentication no
|
||||||
|
@ -81,16 +84,16 @@ AuthorizedKeysFile .ssh/authorized_keys
|
||||||
# If you just want the PAM account and session checks to run without
|
# If you just want the PAM account and session checks to run without
|
||||||
# PAM authentication, then enable this but set PasswordAuthentication
|
# PAM authentication, then enable this but set PasswordAuthentication
|
||||||
# and ChallengeResponseAuthentication to 'no'.
|
# and ChallengeResponseAuthentication to 'no'.
|
||||||
#UsePAM no
|
UsePAM yes
|
||||||
|
|
||||||
#AllowAgentForwarding yes
|
#AllowAgentForwarding yes
|
||||||
#AllowTcpForwarding yes
|
#AllowTcpForwarding yes
|
||||||
#GatewayPorts no
|
#GatewayPorts no
|
||||||
#X11Forwarding no
|
X11Forwarding yes
|
||||||
#X11DisplayOffset 10
|
#X11DisplayOffset 10
|
||||||
#X11UseLocalhost yes
|
#X11UseLocalhost yes
|
||||||
#PermitTTY yes
|
#PermitTTY yes
|
||||||
#PrintMotd yes
|
PrintMotd no
|
||||||
#PrintLastLog yes
|
#PrintLastLog yes
|
||||||
#TCPKeepAlive yes
|
#TCPKeepAlive yes
|
||||||
#PermitUserEnvironment no
|
#PermitUserEnvironment no
|
||||||
|
@ -107,8 +110,11 @@ AuthorizedKeysFile .ssh/authorized_keys
|
||||||
# no default banner path
|
# no default banner path
|
||||||
#Banner none
|
#Banner none
|
||||||
|
|
||||||
|
# Allow client to pass locale environment variables
|
||||||
|
AcceptEnv LANG LC_*
|
||||||
|
|
||||||
# override default of no subsystems
|
# override default of no subsystems
|
||||||
Subsystem sftp /usr/libexec/sftp-server
|
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||||
|
|
||||||
# Example of overriding settings on a per-user basis
|
# Example of overriding settings on a per-user basis
|
||||||
#Match User anoncvs
|
#Match User anoncvs
|
||||||
|
|
|
@ -56,6 +56,35 @@ Arguments may optionally be enclosed in double quotes
|
||||||
.Pq \&"
|
.Pq \&"
|
||||||
in order to represent arguments containing spaces.
|
in order to represent arguments containing spaces.
|
||||||
.Pp
|
.Pp
|
||||||
|
Note that the Debian
|
||||||
|
.Ic openssh-server
|
||||||
|
package sets several options as standard in
|
||||||
|
.Pa /etc/ssh/sshd_config
|
||||||
|
which are not the default in
|
||||||
|
.Xr sshd 8 :
|
||||||
|
.Pp
|
||||||
|
.Bl -bullet -offset indent -compact
|
||||||
|
.It
|
||||||
|
.Cm Include /etc/ssh/sshd_config.d/*.conf
|
||||||
|
.It
|
||||||
|
.Cm ChallengeResponseAuthentication No no
|
||||||
|
.It
|
||||||
|
.Cm X11Forwarding No yes
|
||||||
|
.It
|
||||||
|
.Cm PrintMotd No no
|
||||||
|
.It
|
||||||
|
.Cm AcceptEnv No LANG LC_*
|
||||||
|
.It
|
||||||
|
.Cm Subsystem No sftp /usr/lib/openssh/sftp-server
|
||||||
|
.It
|
||||||
|
.Cm UsePAM No yes
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
.Pa /etc/ssh/sshd_config.d/*.conf
|
||||||
|
files are included at the start of the configuration file, so options set
|
||||||
|
there will override those in
|
||||||
|
.Pa /etc/ssh/sshd_config.
|
||||||
|
.Pp
|
||||||
The possible
|
The possible
|
||||||
keywords and their meanings are as follows (note that
|
keywords and their meanings are as follows (note that
|
||||||
keywords are case-insensitive and arguments are case-sensitive):
|
keywords are case-insensitive and arguments are case-sensitive):
|
||||||
|
|
Loading…
Reference in New Issue