summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-09 16:10:18 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 14:45:02 +0000
commit8086961f9f4ad834e9c3b09b6e2c80273be1c506 (patch)
tree8fe8ff2f139a625e4c90b536593f6bc9811865e6
parenta208834b2d1811dac7054d7fdcdd04672f8b19f6 (diff)
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
-rw-r--r--readconf.c2
-rw-r--r--ssh.124
-rw-r--r--ssh_config8
-rw-r--r--ssh_config.526
-rw-r--r--sshd_config18
-rw-r--r--sshd_config.529
6 files changed, 98 insertions, 9 deletions
diff --git a/readconf.c b/readconf.c
index 7f251dd4a..e82024678 100644
--- a/readconf.c
+++ b/readconf.c
@@ -2087,7 +2087,7 @@ fill_default_options(Options * options)
2087 if (options->forward_x11 == -1) 2087 if (options->forward_x11 == -1)
2088 options->forward_x11 = 0; 2088 options->forward_x11 = 0;
2089 if (options->forward_x11_trusted == -1) 2089 if (options->forward_x11_trusted == -1)
2090 options->forward_x11_trusted = 0; 2090 options->forward_x11_trusted = 1;
2091 if (options->forward_x11_timeout == -1) 2091 if (options->forward_x11_timeout == -1)
2092 options->forward_x11_timeout = 1200; 2092 options->forward_x11_timeout = 1200;
2093 /* 2093 /*
diff --git a/ssh.1 b/ssh.1
index b33a8049f..a8967c2f8 100644
--- a/ssh.1
+++ b/ssh.1
@@ -809,6 +809,16 @@ directive in
809.Xr ssh_config 5 809.Xr ssh_config 5
810for more information. 810for more information.
811.Pp 811.Pp
812(Debian-specific: X11 forwarding is not subjected to X11 SECURITY extension
813restrictions by default, because too many programs currently crash in this
814mode.
815Set the
816.Cm ForwardX11Trusted
817option to
818.Dq no
819to restore the upstream behaviour.
820This may change in future depending on client-side improvements.)
821.Pp
812.It Fl x 822.It Fl x
813Disables X11 forwarding. 823Disables X11 forwarding.
814.Pp 824.Pp
@@ -817,6 +827,20 @@ Enables trusted X11 forwarding.
817Trusted X11 forwardings are not subjected to the X11 SECURITY extension 827Trusted X11 forwardings are not subjected to the X11 SECURITY extension
818controls. 828controls.
819.Pp 829.Pp
830(Debian-specific: In the default configuration, this option is equivalent to
831.Fl X ,
832since
833.Cm ForwardX11Trusted
834defaults to
835.Dq yes
836as described above.
837Set the
838.Cm ForwardX11Trusted
839option to
840.Dq no
841to restore the upstream behaviour.
842This may change in future depending on client-side improvements.)
843.Pp
820.It Fl y 844.It Fl y
821Send log information using the 845Send log information using the
822.Xr syslog 3 846.Xr syslog 3
diff --git a/ssh_config b/ssh_config
index 1ff999b68..8a55237b9 100644
--- a/ssh_config
+++ b/ssh_config
@@ -17,9 +17,12 @@
17# list of available options, their meanings and defaults, please see the 17# list of available options, their meanings and defaults, please see the
18# ssh_config(5) man page. 18# ssh_config(5) man page.
19 19
20# Host * 20Include /etc/ssh/ssh_config.d/*.conf
21
22Host *
21# ForwardAgent no 23# ForwardAgent no
22# ForwardX11 no 24# ForwardX11 no
25# ForwardX11Trusted yes
23# PasswordAuthentication yes 26# PasswordAuthentication yes
24# HostbasedAuthentication no 27# HostbasedAuthentication no
25# GSSAPIAuthentication no 28# GSSAPIAuthentication no
@@ -45,3 +48,6 @@
45# VisualHostKey no 48# VisualHostKey no
46# ProxyCommand ssh -q -W %h:%p gateway.example.com 49# ProxyCommand ssh -q -W %h:%p gateway.example.com
47# RekeyLimit 1G 1h 50# RekeyLimit 1G 1h
51 SendEnv LANG LC_*
52 HashKnownHosts yes
53 GSSAPIAuthentication yes
diff --git a/ssh_config.5 b/ssh_config.5
index c6eaa63e7..34dc2d51b 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -71,6 +71,29 @@ Since the first obtained value for each parameter is used, more
71host-specific declarations should be given near the beginning of the 71host-specific declarations should be given near the beginning of the
72file, and general defaults at the end. 72file, and general defaults at the end.
73.Pp 73.Pp
74Note that the Debian
75.Ic openssh-client
76package sets several options as standard in
77.Pa /etc/ssh/ssh_config
78which are not the default in
79.Xr ssh 1 :
80.Pp
81.Bl -bullet -offset indent -compact
82.It
83.Cm Include /etc/ssh/ssh_config.d/*.conf
84.It
85.Cm SendEnv No LANG LC_*
86.It
87.Cm HashKnownHosts No yes
88.It
89.Cm GSSAPIAuthentication No yes
90.El
91.Pp
92.Pa /etc/ssh/ssh_config.d/*.conf
93files are included at the start of the system-wide configuration file, so
94options set there will override those in
95.Pa /etc/ssh/ssh_config.
96.Pp
74The file contains keyword-argument pairs, one per line. 97The file contains keyword-argument pairs, one per line.
75Lines starting with 98Lines starting with
76.Ql # 99.Ql #
@@ -729,11 +752,12 @@ elapsed.
729.It Cm ForwardX11Trusted 752.It Cm ForwardX11Trusted
730If this option is set to 753If this option is set to
731.Cm yes , 754.Cm yes ,
755(the Debian-specific default),
732remote X11 clients will have full access to the original X11 display. 756remote X11 clients will have full access to the original X11 display.
733.Pp 757.Pp
734If this option is set to 758If this option is set to
735.Cm no 759.Cm no
736(the default), 760(the upstream default),
737remote X11 clients will be considered untrusted and prevented 761remote X11 clients will be considered untrusted and prevented
738from stealing or tampering with data belonging to trusted X11 762from stealing or tampering with data belonging to trusted X11
739clients. 763clients.
diff --git a/sshd_config b/sshd_config
index 2c48105f8..459c1b230 100644
--- a/sshd_config
+++ b/sshd_config
@@ -10,6 +10,8 @@
10# possible, but leave them commented. Uncommented options override the 10# possible, but leave them commented. Uncommented options override the
11# default value. 11# default value.
12 12
13Include /etc/ssh/sshd_config.d/*.conf
14
13#Port 22 15#Port 22
14#AddressFamily any 16#AddressFamily any
15#ListenAddress 0.0.0.0 17#ListenAddress 0.0.0.0
@@ -57,8 +59,9 @@ AuthorizedKeysFile .ssh/authorized_keys
57#PasswordAuthentication yes 59#PasswordAuthentication yes
58#PermitEmptyPasswords no 60#PermitEmptyPasswords no
59 61
60# Change to no to disable s/key passwords 62# Change to yes to enable challenge-response passwords (beware issues with
61#ChallengeResponseAuthentication yes 63# some PAM modules and threads)
64ChallengeResponseAuthentication no
62 65
63# Kerberos options 66# Kerberos options
64#KerberosAuthentication no 67#KerberosAuthentication no
@@ -81,16 +84,16 @@ AuthorizedKeysFile .ssh/authorized_keys
81# If you just want the PAM account and session checks to run without 84# If you just want the PAM account and session checks to run without
82# PAM authentication, then enable this but set PasswordAuthentication 85# PAM authentication, then enable this but set PasswordAuthentication
83# and ChallengeResponseAuthentication to 'no'. 86# and ChallengeResponseAuthentication to 'no'.
84#UsePAM no 87UsePAM yes
85 88
86#AllowAgentForwarding yes 89#AllowAgentForwarding yes
87#AllowTcpForwarding yes 90#AllowTcpForwarding yes
88#GatewayPorts no 91#GatewayPorts no
89#X11Forwarding no 92X11Forwarding yes
90#X11DisplayOffset 10 93#X11DisplayOffset 10
91#X11UseLocalhost yes 94#X11UseLocalhost yes
92#PermitTTY yes 95#PermitTTY yes
93#PrintMotd yes 96PrintMotd no
94#PrintLastLog yes 97#PrintLastLog yes
95#TCPKeepAlive yes 98#TCPKeepAlive yes
96#PermitUserEnvironment no 99#PermitUserEnvironment no
@@ -107,8 +110,11 @@ AuthorizedKeysFile .ssh/authorized_keys
107# no default banner path 110# no default banner path
108#Banner none 111#Banner none
109 112
113# Allow client to pass locale environment variables
114AcceptEnv LANG LC_*
115
110# override default of no subsystems 116# override default of no subsystems
111Subsystem sftp /usr/libexec/sftp-server 117Subsystem sftp /usr/lib/openssh/sftp-server
112 118
113# Example of overriding settings on a per-user basis 119# Example of overriding settings on a per-user basis
114#Match User anoncvs 120#Match User anoncvs
diff --git a/sshd_config.5 b/sshd_config.5
index 25f4b8117..e8271be74 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -56,6 +56,35 @@ Arguments may optionally be enclosed in double quotes
56.Pq \&" 56.Pq \&"
57in order to represent arguments containing spaces. 57in order to represent arguments containing spaces.
58.Pp 58.Pp
59Note that the Debian
60.Ic openssh-server
61package sets several options as standard in
62.Pa /etc/ssh/sshd_config
63which are not the default in
64.Xr sshd 8 :
65.Pp
66.Bl -bullet -offset indent -compact
67.It
68.Cm Include /etc/ssh/sshd_config.d/*.conf
69.It
70.Cm ChallengeResponseAuthentication No no
71.It
72.Cm X11Forwarding No yes
73.It
74.Cm PrintMotd No no
75.It
76.Cm AcceptEnv No LANG LC_*
77.It
78.Cm Subsystem No sftp /usr/lib/openssh/sftp-server
79.It
80.Cm UsePAM No yes
81.El
82.Pp
83.Pa /etc/ssh/sshd_config.d/*.conf
84files are included at the start of the configuration file, so options set
85there will override those in
86.Pa /etc/ssh/sshd_config.
87.Pp
59The possible 88The possible
60keywords and their meanings are as follows (note that 89keywords and their meanings are as follows (note that
61keywords are case-insensitive and arguments are case-sensitive): 90keywords are case-insensitive and arguments are case-sensitive):