Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32966 - openssh GSSAPI authentication

Attached to Project: Arch Linux
Opened by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 03:20 GMT
Last edited by Gaetan Bisson (vesath) - Thursday, 06 December 2012, 21:21 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

For some reason, GSSAPI authentication in openssh is not working in Arch Linux. When connecting from the client (on any distribution), the connection always fails with "Connection closed by UNKNOWN" and the server side doesn't produce any error messages (and doesn't log anything unless I set the logging level to debug3).

Client (with "-vvv"): http://pastie.org/pastes/5481968/text
Server (with debug3 logging): http://pastie.org/pastes/5481975/text
sshd_config: http://pastie.org/pastes/5481978/text

I'm using the exact same configuration file for my other servers (running other distros) and they all work fine. I'm not sure why it's not working for Arch though. I tried compiling my own openssh binaries and the problem still persists, so it may be a problem with one of the dependencies.

In case it matters, Arch Linux client connecting to other ssh servers with GSSAPI authentication works fine, but not the other way around.
This task depends upon

Closed by  Gaetan Bisson (vesath)
Thursday, 06 December 2012, 21:21 GMT
Reason for closing:  Not a bug
Comment by Gaetan Bisson (vesath) - Wednesday, 05 December 2012, 04:38 GMT
So the issue certainly lies with the server, not the client. What version of the OpenSSH server do you use? Is it the same on Arch and on the other platforms?

Could you try building openssh with exactly the same tarball and options on Arch and another platform where it works? Comparing the two config.log might give us an obvious answer as to what is wrong.
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 05:23 GMT
Thanks for the reply!

One of my servers (running Ubuntu) has version 6.0p1 of the OpenSSH server and the kdc server (running Fedora) has version 6.1p1. I'll try compiling with the same options on Arch and Fedora and I'll post the config.log files here.
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 06:01 GMT
Here's are the logs from compiling:

Fedora:
Build log: http://ompldr.org/vZ2tsbA/sshbuild.log
config.log: http://ompldr.org/vZ2tsbQ/config.log

Arch:
Build log: http://ompldr.org/vZ2tsbw/sshbuild.log
config.log: http://ompldr.org/vZ2tscQ/config.log

I used this script to build OpenSSH: http://ompldr.org/vZ2tseg/compile_openssh.sh
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 06:03 GMT
This is interesting. Compiling OpenSSH with those options causes the same error on Fedora. Looking at their packaging, it seems they do not build with ldns, while Arch does.
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 06:14 GMT
I tried building without "--with-ldns" and now the OpenSSH server works fine on both platforms :)
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 06:31 GMT
It turns out that ldns is not the problem. During the build, I changed UsePrivilegeSeparation to 'no' in the configuration as OpenSSH wanted to run as the sshd user, which does not exist.

Arch's OpenSSH in the repositories works perfectly fine when UsePrivilegeSeparation is turned off. Now, I wonder why the nobody user prevents GSSAPI from working.
Comment by Andrew Gunnerson (chenxiaolong) - Wednesday, 05 December 2012, 07:03 GMT
Sorry for posting so many comments. After doing some more testing, it does seem that dropping privileges stops GSSAPI from working, but I don't think it's limited to the 'nobody' user. I tried adding a new user with:

$ adduser --system sshdaemon

and then compiling OpenSSH with the "--with-privsep-user=sshdaemon" option, but that fails with the same error message.
Comment by Gaetan Bisson (vesath) - Wednesday, 05 December 2012, 09:11 GMT
Thanks for getting to the bottom of this. Since I am not really familiar with GSSAPI and this seems to be an intrinsic problem to using it with UsePrivilegeSeparation/unpriviliged daemon, I suggest you take this issue to the OpenSSH support list; see: http://www.openssh.com/list.html
Let me know if there is any change I could make to the package that would make sense and restore the GSSAPI features.
Comment by Andrew Gunnerson (chenxiaolong) - Thursday, 06 December 2012, 07:50 GMT
Thanks for the reply! I didn't end up sending a message to the mailing list as I happened to find a very useful part of the documentation (actually, the changelog) that explained exactly why this is happening.

From http://www.openssh.com/txt/release-5.9: OpenSSH is using the systrace sandbox by default, which (I assume because of the syscall whitelist) is too limiting for GSSAPI. Looking at the packaging for other distros, they all seem to be working around this in one way or another.

Ubuntu (Line 306: http://tinyurl.com/alu6ypw) is not using the sandbox at all. They just set UsePrivilegeSeparation to "yes" to avoid the issue.
Fedora (Line 531: http://tinyurl.com/bxo3kob) and openSUSE (Line 142: http://tinyurl.com/cfbordn) are both using rlimit as the sandboxing mechanism.

I'm not sure which method you would prefer. I would personally compile with "--with-sandbox=rlimit".
Comment by Gaetan Bisson (vesath) - Thursday, 06 December 2012, 10:57 GMT
Well I like the current sandbox: openssh's configure selects it by default when possible, and it is indeed the best choice for most scenarios.
Since the default sshd_config turns GSSAPI off, I guess it is reasonable to expect anyone turning it on to also disable sandboxing.
So I am inclined to do nothing unless I have missed a simple way to make this easier on GSSAPI users without impacting the majority of us who just want the best possible options by default.
Comment by Andrew Gunnerson (chenxiaolong) - Thursday, 06 December 2012, 19:53 GMT
@Gaetan: I'm perfectly fine with that. I originally opened this bug thinking that there was something wrong with Arch's packages. Now that we know it's just a configuration issue, I think we can close the bug :)
Comment by Gaetan Bisson (vesath) - Thursday, 06 December 2012, 21:21 GMT
Alright. Thanks.

Loading...