diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:10:18 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-02-21 12:10:36 +0000 |
commit | cc80ecc65d57a9e68ce84d67bcfece281ffa0e9f (patch) | |
tree | ae0f22c19546882adbc8835e068ebafd4e0a4d90 | |
parent | a208834b2d1811dac7054d7fdcdd04672f8b19f6 (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.
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.
Document all of this.
Author: Russ Allbery <rra@debian.org>
Forwarded: not-needed
Last-Update: 2020-02-19
Patch-Name: debian-config.patch
-rw-r--r-- | readconf.c | 2 | ||||
-rw-r--r-- | ssh.1 | 24 | ||||
-rw-r--r-- | ssh_config | 6 | ||||
-rw-r--r-- | ssh_config.5 | 19 | ||||
-rw-r--r-- | sshd_config | 16 | ||||
-rw-r--r-- | sshd_config.5 | 22 |
6 files changed, 80 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 | /* |
@@ -809,6 +809,16 @@ directive in | |||
809 | .Xr ssh_config 5 | 809 | .Xr ssh_config 5 |
810 | for more information. | 810 | for more information. |
811 | .Pp | 811 | .Pp |
812 | (Debian-specific: X11 forwarding is not subjected to X11 SECURITY extension | ||
813 | restrictions by default, because too many programs currently crash in this | ||
814 | mode. | ||
815 | Set the | ||
816 | .Cm ForwardX11Trusted | ||
817 | option to | ||
818 | .Dq no | ||
819 | to restore the upstream behaviour. | ||
820 | This may change in future depending on client-side improvements.) | ||
821 | .Pp | ||
812 | .It Fl x | 822 | .It Fl x |
813 | Disables X11 forwarding. | 823 | Disables X11 forwarding. |
814 | .Pp | 824 | .Pp |
@@ -817,6 +827,20 @@ Enables trusted X11 forwarding. | |||
817 | Trusted X11 forwardings are not subjected to the X11 SECURITY extension | 827 | Trusted X11 forwardings are not subjected to the X11 SECURITY extension |
818 | controls. | 828 | controls. |
819 | .Pp | 829 | .Pp |
830 | (Debian-specific: In the default configuration, this option is equivalent to | ||
831 | .Fl X , | ||
832 | since | ||
833 | .Cm ForwardX11Trusted | ||
834 | defaults to | ||
835 | .Dq yes | ||
836 | as described above. | ||
837 | Set the | ||
838 | .Cm ForwardX11Trusted | ||
839 | option to | ||
840 | .Dq no | ||
841 | to restore the upstream behaviour. | ||
842 | This may change in future depending on client-side improvements.) | ||
843 | .Pp | ||
820 | .It Fl y | 844 | .It Fl y |
821 | Send log information using the | 845 | Send log information using the |
822 | .Xr syslog 3 | 846 | .Xr syslog 3 |
diff --git a/ssh_config b/ssh_config index 1ff999b68..6dd6ecf87 100644 --- a/ssh_config +++ b/ssh_config | |||
@@ -17,9 +17,10 @@ | |||
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 * | 20 | Host * |
21 | # ForwardAgent no | 21 | # ForwardAgent no |
22 | # ForwardX11 no | 22 | # ForwardX11 no |
23 | # ForwardX11Trusted yes | ||
23 | # PasswordAuthentication yes | 24 | # PasswordAuthentication yes |
24 | # HostbasedAuthentication no | 25 | # HostbasedAuthentication no |
25 | # GSSAPIAuthentication no | 26 | # GSSAPIAuthentication no |
@@ -45,3 +46,6 @@ | |||
45 | # VisualHostKey no | 46 | # VisualHostKey no |
46 | # ProxyCommand ssh -q -W %h:%p gateway.example.com | 47 | # ProxyCommand ssh -q -W %h:%p gateway.example.com |
47 | # RekeyLimit 1G 1h | 48 | # RekeyLimit 1G 1h |
49 | SendEnv LANG LC_* | ||
50 | HashKnownHosts yes | ||
51 | GSSAPIAuthentication yes | ||
diff --git a/ssh_config.5 b/ssh_config.5 index c6eaa63e7..5c90d3e02 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -71,6 +71,22 @@ Since the first obtained value for each parameter is used, more | |||
71 | host-specific declarations should be given near the beginning of the | 71 | host-specific declarations should be given near the beginning of the |
72 | file, and general defaults at the end. | 72 | file, and general defaults at the end. |
73 | .Pp | 73 | .Pp |
74 | Note that the Debian | ||
75 | .Ic openssh-client | ||
76 | package sets several options as standard in | ||
77 | .Pa /etc/ssh/ssh_config | ||
78 | which are not the default in | ||
79 | .Xr ssh 1 : | ||
80 | .Pp | ||
81 | .Bl -bullet -offset indent -compact | ||
82 | .It | ||
83 | .Cm SendEnv No LANG LC_* | ||
84 | .It | ||
85 | .Cm HashKnownHosts No yes | ||
86 | .It | ||
87 | .Cm GSSAPIAuthentication No yes | ||
88 | .El | ||
89 | .Pp | ||
74 | The file contains keyword-argument pairs, one per line. | 90 | The file contains keyword-argument pairs, one per line. |
75 | Lines starting with | 91 | Lines starting with |
76 | .Ql # | 92 | .Ql # |
@@ -729,11 +745,12 @@ elapsed. | |||
729 | .It Cm ForwardX11Trusted | 745 | .It Cm ForwardX11Trusted |
730 | If this option is set to | 746 | If this option is set to |
731 | .Cm yes , | 747 | .Cm yes , |
748 | (the Debian-specific default), | ||
732 | remote X11 clients will have full access to the original X11 display. | 749 | remote X11 clients will have full access to the original X11 display. |
733 | .Pp | 750 | .Pp |
734 | If this option is set to | 751 | If this option is set to |
735 | .Cm no | 752 | .Cm no |
736 | (the default), | 753 | (the upstream default), |
737 | remote X11 clients will be considered untrusted and prevented | 754 | remote X11 clients will be considered untrusted and prevented |
738 | from stealing or tampering with data belonging to trusted X11 | 755 | from stealing or tampering with data belonging to trusted X11 |
739 | clients. | 756 | clients. |
diff --git a/sshd_config b/sshd_config index 2c48105f8..ed8272f6d 100644 --- a/sshd_config +++ b/sshd_config | |||
@@ -57,8 +57,9 @@ AuthorizedKeysFile .ssh/authorized_keys | |||
57 | #PasswordAuthentication yes | 57 | #PasswordAuthentication yes |
58 | #PermitEmptyPasswords no | 58 | #PermitEmptyPasswords no |
59 | 59 | ||
60 | # Change to no to disable s/key passwords | 60 | # Change to yes to enable challenge-response passwords (beware issues with |
61 | #ChallengeResponseAuthentication yes | 61 | # some PAM modules and threads) |
62 | ChallengeResponseAuthentication no | ||
62 | 63 | ||
63 | # Kerberos options | 64 | # Kerberos options |
64 | #KerberosAuthentication no | 65 | #KerberosAuthentication no |
@@ -81,16 +82,16 @@ AuthorizedKeysFile .ssh/authorized_keys | |||
81 | # If you just want the PAM account and session checks to run without | 82 | # If you just want the PAM account and session checks to run without |
82 | # PAM authentication, then enable this but set PasswordAuthentication | 83 | # PAM authentication, then enable this but set PasswordAuthentication |
83 | # and ChallengeResponseAuthentication to 'no'. | 84 | # and ChallengeResponseAuthentication to 'no'. |
84 | #UsePAM no | 85 | UsePAM yes |
85 | 86 | ||
86 | #AllowAgentForwarding yes | 87 | #AllowAgentForwarding yes |
87 | #AllowTcpForwarding yes | 88 | #AllowTcpForwarding yes |
88 | #GatewayPorts no | 89 | #GatewayPorts no |
89 | #X11Forwarding no | 90 | X11Forwarding yes |
90 | #X11DisplayOffset 10 | 91 | #X11DisplayOffset 10 |
91 | #X11UseLocalhost yes | 92 | #X11UseLocalhost yes |
92 | #PermitTTY yes | 93 | #PermitTTY yes |
93 | #PrintMotd yes | 94 | PrintMotd no |
94 | #PrintLastLog yes | 95 | #PrintLastLog yes |
95 | #TCPKeepAlive yes | 96 | #TCPKeepAlive yes |
96 | #PermitUserEnvironment no | 97 | #PermitUserEnvironment no |
@@ -107,8 +108,11 @@ AuthorizedKeysFile .ssh/authorized_keys | |||
107 | # no default banner path | 108 | # no default banner path |
108 | #Banner none | 109 | #Banner none |
109 | 110 | ||
111 | # Allow client to pass locale environment variables | ||
112 | AcceptEnv LANG LC_* | ||
113 | |||
110 | # override default of no subsystems | 114 | # override default of no subsystems |
111 | Subsystem sftp /usr/libexec/sftp-server | 115 | Subsystem sftp /usr/lib/openssh/sftp-server |
112 | 116 | ||
113 | # Example of overriding settings on a per-user basis | 117 | # Example of overriding settings on a per-user basis |
114 | #Match User anoncvs | 118 | #Match User anoncvs |
diff --git a/sshd_config.5 b/sshd_config.5 index 25f4b8117..b8bea2ad7 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -56,6 +56,28 @@ Arguments may optionally be enclosed in double quotes | |||
56 | .Pq \&" | 56 | .Pq \&" |
57 | in order to represent arguments containing spaces. | 57 | in order to represent arguments containing spaces. |
58 | .Pp | 58 | .Pp |
59 | Note that the Debian | ||
60 | .Ic openssh-server | ||
61 | package sets several options as standard in | ||
62 | .Pa /etc/ssh/sshd_config | ||
63 | which are not the default in | ||
64 | .Xr sshd 8 : | ||
65 | .Pp | ||
66 | .Bl -bullet -offset indent -compact | ||
67 | .It | ||
68 | .Cm ChallengeResponseAuthentication No no | ||
69 | .It | ||
70 | .Cm X11Forwarding No yes | ||
71 | .It | ||
72 | .Cm PrintMotd No no | ||
73 | .It | ||
74 | .Cm AcceptEnv No LANG LC_* | ||
75 | .It | ||
76 | .Cm Subsystem No sftp /usr/lib/openssh/sftp-server | ||
77 | .It | ||
78 | .Cm UsePAM No yes | ||
79 | .El | ||
80 | .Pp | ||
59 | The possible | 81 | The possible |
60 | keywords and their meanings are as follows (note that | 82 | keywords and their meanings are as follows (note that |
61 | keywords are case-insensitive and arguments are case-sensitive): | 83 | keywords are case-insensitive and arguments are case-sensitive): |