-
-
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
Homedir gets not correctly created at first login #350
Comments
I've got a setup just like what you describe that I managed to get working. I'm running CentOS 7 and I installed the xrdp package (version 0.9.0-4) from epel. Most of my trouble was from SELinux. Here are the steps that I went through to get everything working:
Edit
Try logging in. It should fail creating the home directory because of SELinux. Create a SELinux policy module to allow this:
Try logging in again. It will still fail. Now complete the SELinux policy module.
After this, xrdp worked as expected with home directories created at first login. And I did not have to adjust the delay_ms setting in xrdp.ini. Here are the contents of xrdp_mkhomedir.te:
|
I don't have SELinux installed, so this seems not to be my problem. Also, I can't solve my issue by tweaking the delay_ms setting - I already tried this out. |
I am having the same problem if if I am using xorgxrdp, but the problem is the same. From xrdp-sesman.log
from auth.log:
so we have at 16:10:22 an Xorg session starting but the pam messages are 10 seconds later, as the timeout. looking at sesman/session.c
wait_for_xserver waits for the 10 seconds that we see in the logs for a Xserver which is not started and afterwards proceeds with auth_start_session, where the pam session actually happens. Knowing almost nothing about both xrdp and pam, I quickly run a test building xrdp-sesman blindly moving auth_start_session(data, display); (538) above both forks (530 and 480) and, quite confusingly for me, it works in both cases. Unfortunately I did not find a workaround besides asking the users to re-login after the first time.... |
I can confirm this bug. I'm running xrdp in an environment where pam authenticates against ldap/kerberos. So I need to create home directories by pam_mkhomedir. I tried the exact same as you: moving the line auth_start_session(data, display); (538) directly before (530). Then the home directory gets created and X just starts normally. I'm also not a pam specialist, but I would assume that the right place to call "auth_start_session" is just before line 530. Maybe @jsorg71 or some other programmer could tell us that. |
Just for the record - it's not only mkhomedir. ecryptfs and others come to mind. +1 for the fix. |
Btw, did I mention we should really strive to decouple session management from xrdp, by e.g. connecting into LightDM some day ;)? |
Could please somebody fix this, it is also a security issue, as pam_limits.so will not work too, so it is not possible to limit sessions! |
I'll do a PR |
I added #694 |
Has a CVE already been assigned for this issue? Thanks |
Am 15.03.2017 um 23:41 schrieb setharnold:
Has a CVE already been assigned for this issue? Thanks
No.
Sincerly,
Klaus
…--
Rechnerbetriebsgruppe / IT, Fakultät für Physik
Klaus Steinberger
FAX: +49 89 28914280
Tel: +49 89 28914287
|
Use CVE-2017-6967. |
JFYI, I’d prefer to not introduce a hard dependency on LightDM (or any login manager, really) as those tend to introduce tons of other dependencies, problems, etc. and make it much harder to just drop xrdp and xorgxrdp on a system and It Just Works. |
and make it much harder to just drop xrdp
and xorgxrdp on a system and It Just Works.
Except it doesn't.
We cannot have identical sessions for RDP and local logins at Teckids because sesman handling of PAM is incomplete and even crashes when enabling some PAM modules otherwise used in the desktop session.
xrdp does not "just work" as long as it cannot run the same desktop session as local users.
|
Dominik George dixit:
We cannot have identical sessions for RDP and local logins
Precisely.
I don’t want to be forced to have identical sessions.
(Especially as things like which Xmodmap to load depend
on whether it’s xrdp or not.)
There’s also the “startx” and “xinit” type of sessions,
so this issue already exists.
I do understand there are situations in which people might
want such identical sessions, and I’m not against supporting
that, just not forcing it, by whatever means sensible (still
not sure calling out to a login manager is right, fixing the
PAM stuff might be more helpful).
and even crashes when enabling some PAM modules otherwise used in the
desktop session
That’s probably related to #858143 and thus already fixed in
experimental and xrdp upstream. (Invitation to try.)
gn8,
//mirabilos
--
15:39⎜«mika:#grml» mira|AO: "mit XFree86® wär’ das nicht passiert" - muhaha
15:48⎜<thkoehler:#grml> also warum machen die xorg Jungs eigentlich alles
kaputt? :) 15:49⎜<novoid:#grml> thkoehler: weil sie als Kinder nie den
gebauten Turm selber umschmeissen durften? -- ~/.Xmodmap wonders…
|
Since this is still a problem, is there any non-source code change workaround? |
Be good to get this fixed. My experience in Ubuntu 16.04 is that pam_mkhomedir creates a home dir upon xrdp login, but it's root-permissioned, so useless to the user in question (they just see a blue screen when trying to start an xrdp session). Permissioned fine during ssh login. |
I believe I must have encountered the permission issue on Ubuntu 16.04. Here's what I have in my setup notes:
|
Yes evanlinde, umask=0077 fixes home dir ownership issue. Thanks. |
Same here. only works whenever I add the pam_mkhomedir line below. XRDP was failing to create a home directory for my AD user on the first login. ` /etc/pam.d/xrdp-sesman BEGIN ANSIBLE MANAGED BLOCKsession required pam_env.so readenv=1 user_readenv=0 END ANSIBLE MANAGED BLOCK@include common-auth |
Great, I'll try xrdp with VNC |
I'm opening this as a new issue, although my problems have already been started to be discussed at #325 which has been marked as "closed" before finding a solution for my specific problem.
Short summary here:
I built xrdp upstream version and have a problem when connecting to the server for the very first time with a user. The server should then create a homedir (via pam_mkhomedir). The server is a member of an active directory, PAM is configured to authenticate via samba/winbind and create home directories for users on their first login. This works perfectly for e.g. ssh or other services but not for xrdp.
I had a look at bugs #182 and #196 which seem similar but have a different background. The problem of these referenced bugs is that VNC needs some time to start up before connecting to it - so a timeout (loop) has been implemented. This is not the case here.
In this bug, VNC starts but there seems to be a problem with the order a full PAM based authentification. xrdp is supposed to first do the PAM authentication (which would initially creating a users' home directory) and then start VNC. This seems not to work as expected somehow... In general, the home directory gets created somewhen, but obviously too late in the process so that VNC spits out the error lines
If I kill the Xvnc process (or completely restart xrdp) and try it again (after the homedir got created while the first login try), it works. If I create the user's home directory manually it also works.
I wasn't able to let PAM create the homedir before VNC starts, I tried almost every possible order of "session" entries (especially those with pam_mkhomedir.so at the beginning).
The text was updated successfully, but these errors were encountered: