-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No user session created with xrdp and pam_systemd_home account module #1684
Comments
Well, from what little research I've done on this, it seems that The error messages are consistent with this. You've mentioned local logins and ssh are working OK. Are they using Thanks. |
Local logins and ssh both include The weird thing is that the Curious if this is reproducible on other distributions? |
I'll get a manjaro VM set up so I can investigate this. I'll let you know what I discover. |
Hi @usul0184 I've got a Manjaro VM up. There seem to be two issues here:-
So I think the pam_systemd_home messages above, which are after all related to the pam
which brings us back to your comments on #778. My findings seem to be at odds with yours. Are you saying that when you comment out There also seem to be other session-related issues with Manjaro. If I log in on the console and log out again, |
Thanks so much for looking into this! My thoughts below. Yes, if I comment out I’ve added
If I comment out
It makes sense that I agree there are other session-related issues; it seems that certain processes aren’t terminated when logging out. Some quick Googling seems to indicate that is a problem with the individual programs. Setting |
I'm afraid I've hit a bit of a brick wall with this.
Regarding the second, this seems like such a basic thing to be missing from an open source distribution that I must be missing something. Can anyone enlighten me? |
Thanks for looking into this! I'm afraid I'm not knowledgeable enough to answer your questions either, unfortunately. But it does seem like other people are having the same problem: https://bbs.archlinux.org/viewtopic.php?id=258716, https://aur.archlinux.org/packages/xrdp/. Hopefully someone with more experience than I do can chime in? |
I've asked for some debugging pointers on the Manjaro forums. Hopefully I'm missing something straightforward. |
Any progress on this @matt335672 ? (I'm the poster of the issue on the arch board) I can add that I have since tried creating a systemd-homed backed user, copied the previously working .xinitrc over and still has the same issue. (If that is any help at all). |
Still nothing to report here. I've figured out how to build a debug systemd package now on Arch, so it's just finding the time to get into the nuts and bolts of this. It's definitely on the list, but please feel free to nag me again. |
Sorry - fat fingers. |
I may have found a reason for this. First thing to say is that on an up-to-date Manjaro (as of 2020-10-27), I'm seeing what @usul0184 sees - if The problem sees to be that When the user is authorized (before the fork), Removing The workaround for now is to comment-out all calls to |
I've done a bit more investigation into this. With systemd version 246, the systemd PAM module connection to the system DBUS is stored in a PAM data object called "systemd-system-bus" - see With that in mind, I've knocked up a PAM session module which can be used after Module is at https://github.com/matt335672/pam_close_systemd_system_dbus It's a hack - use at your own risk, and not in production environments. We'll need changes to sesman to fix this properly. They're significant changes however, and will take a bit of time to implement and test. |
I don't know if its related, but I have always been presented with a bunch of password boxes when logging in over xrdp (various keychains/wallets etc. not being authenticated automatically) - these things are automatically authenticated when I do a local login. |
Does it happen if you use one of the workarounds above? It seems likely this problem is causing polkit to have some problems - see #1709 |
I'll give it a shot when I get home from work tonight. I saw the same behavior (with the missing unlocking etc.) before the arch update to the pam stuff, and I have a colleague on ubuntu who is also seeing similar behavior |
The behavior I'm seeing when logging into KDE through xrdp is that I'm immediately promped to enter my kdewallet password. When I login locally the wallet is automatically unlocked. Various other actions also popup a password box ("sudo") when they need to elevate their priviledges. (systemd homed commented out in pam for this, session seems to be created) I am able to enter my password in the authentication box and make it take effect, so I think it something else than #1709 and #1584. It has been like this all the time I've used xrdp (since late '19) so it is not directly related to the recent pam/homed changes (I just wanted to mention it, in case it is related to the pam interactions). My colleague on ubuntu needs to configure his color profiles (or something like that) on every xrdp login (also not happening on local login), so there seem to be some difference between what is defined/connected (xrdp vs local login) If you do not think this is related to this issue, let me know and I'll create a new one. The extra password boxes are more of an observation than a problem for me. |
Hi Chris, I'm not familiar with KDE wallet. I've had a quick poke-around, and you've presumably got All your other issues sound as if they're polkit related. Polkit is used for conferring privileges on applications as needed. Importantly, it makes a distinction between sessions on the console and remote sessions. XRDP is always regarded as a remote session by polkit. Exactly what polkit allows to happen in remote sessions (with or without a password) can be affected by system packaging, but is ultimately the responsbility of the system administrator. The reason for this is that different systems have different user bases and different security profiles. You might be happy to allow a single user to reboot their system from a remote session, but if that system is providing a terminal service for 10 remote users, you may not wish to allow that at all. Please have at the commentary at #1584. We've stepped through enabling polkit logging so that you can see for a particular action what is being requested, and how to allow that. There should be enough info there to help you, but if not feel free to create another issue and we can work through it. The Ubuntu box is also a Polkit thing and affects the I hope that's useful. |
Thank you for the elaborate explanation, I think your observations about the polkit are correct. I have already spent some time with the polkit debug logging from the other issue. Apart from a changed location of the The kde wallet/keyring is mentioned in the pam file for my window manager (sddm) - So I guess that it makes sense that I need to setup xrdp-sesman to work in a similar fashion to match my setup - Too bad you guys aren't clairvoyants and are able to pre-package a pam file for every possible setup 🤣 I'll make sure to forward the ubuntu link! So I guess there is nothing to do, but wait for an updated sesman - luckily the workarounds are not that bad IMO |
Came here from https://bbs.archlinux.org/viewtopic.php?id=258716 - my desktop is a 2 day old i3wm so I didn't realise this was a new issue! Just another datapoint: default i3 loads fine with default xrdp install, my only symptom was broken audio, which led me to a broken systemctl --user and then finally to an unset XDG/DBUS env. Commenting out the line from system-auth sovled the issue here. Edit: some keywords in case someone has the same symptoms as I do: DBUS_SESSION_BUS_ADDRESS blank empty |
Thanks for the datapoint - it may well be of use to someone else. |
Another observation that may or may not be related - i3-wizard fails to create a complete config via an xrdp session, demonstrating the same behvaior as described here: i3/i3#2141 (comment). Elsewhere this is attributed to an "xkb_keymap_key_get_syms_by_level returned no symbols for keycode" error. The pam fix above does not fix this however. Let me know if a new issue needs to be created. |
In general it's a different issue if the PAM fixes don't address it. Hope that's useful. |
Quick progress update - I've got no shareable code as yet, although I'm hoping to have some soon. For new sessions, the fix involves moving the user authentication and authorization into the initial sesman fork (the session leader). This process will ensure that all the necessary PAM calls before and after the session are made from the session leader, taking #350 (CVE-2017-6967 and #688 into account. Systemd compliance pretty much forces this approach to be used. The implementation I'm working on has these features:-
Sesman also provides authentication for reconnection attempts and for proxy requests. These are currently handled in the main sesman process, and unless testing shows otherwise I'm not planning on changing this (but see below). In these instances the PAM contexts are very short-lived and are torn down immediately after authentication. There are some limitations with the current implementation which I've currently left out of scope of the code I'm working on:-
|
Just a minor comment to this thread from a not-so-experienced linux user. At the beginning I had problems to login: the xfce session was not starting after the xrdp login, and after some seconds I was back to xrdp login window. So I edited .xinitrc and manually added the following line: In this way xfce started, but I had problems with authorizations: I cannot update or add any software using Add/Remove Software gui because I get an “authentication” failed message. This seems related to the issue discussed here, so I then applied one of the workaround here described, that is to comment out all lines with reference to |
On Arch via the AUR there was a bug in the build script that causes startwm.sh not to set up a correct environment. Details of the patch to fix it here: https://aur.archlinux.org/cgit/aur.git/commit/?h=xrdp&id=b80ddf90ef7ce5f1688c670e3c85dd3e485f6efb If your startwm.sh doesn't do the same there's a chance you'll see these kind of errors. |
I don't know if I have exactly understood your message (as I wrote, I am not a linux expert), but if the problem you mention is related only to the |
Two xrdp versions have been published for Manjaro on AUR since this issue has been reported. |
Yes it is. It's a huge amount of work however. I'm hoping to get more of the SCP issues sorted out in the next release cycle, but given the architectural changes required (see #1961) it's going to take a while I'm afraid. |
Your page says:
but I could not get XRDP working with Gnome Manjaro without that. Why should I not use it in production? Does it have a serious security problem or something? |
It's relying on an undocumented interface. If the interface changes, it will stop working, but nothing else bad should happen. If you understand what it's doing, and you're OK with a major systemd update possibly breaking it (i.e. this will be caught by your own testing), then go ahead and use it. |
Thanks for the hard work in completing this! Can you please elaborate on what workarounds etc we can now unwind? |
It's just merged into devel, so it will be a while before it hits an actual release. If you're happy to build devel, please do so, but please bear in mind it's a big change, so you might want to do some pre-prod testing of your own. You shouldn't need to use the workaround module at https://github.com/matt335672/pam_close_systemd_system_dbus any more, or comment out pam_systemd_home.so. |
Not sure if it is related in any manner, but I have been using the WA module during last year succesfully. During last weeks I made a Manjaro update (via pamac update -a) and I saw that /etc/pam.d/xrdp-sesman removed configuration for the module (Credentials NOT requested again anymore for instance). It is working fine, UPDATE: I have realized that the fixed is NOT loaded yet in Manjaro. Currently using xrdp 0.9.22.1-1 |
Thanks for a great program! Newbie here, apologies for any inaccuracies. A recent change to the PAM configuration files in Arch repositories seems to be causing problems with xrdp. The current version of
/etc/pam.d/system-auth
contains the followingaccount
section:The first line,
-account [success=1 default=ignore] pam_systemd_home.so
, results in no user session being created in xrdp. The output ofloginctl session-status
isCould not get properties: Unknown object '/org/freedesktop/login1/session/auto'.
This causes problems like being unable to start a polkit authentication agent.For debug purposes, I’ve changed the malfunctioning
pam_systemd_home.so
line toaccount [default=ignore] pam_systemd_home.so debug
.journalctl
shows the following in what I think relevant part when connecting to xrdp:If the
pam_systemd_home.so
line is removed, everything works fine. Note that I do not havesystemd-homed
running. Xorg vs Xvnc makes no difference, nor does having astartwm.sh
with justexec xterm
in it.Not sure if this is an xrdp problem or something else; for what it’s worth, local login and ssh work fine.
Additional info:
xterm
fails)The text was updated successfully, but these errors were encountered: