Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Cannot Login with AD user #27

Closed
amalcp opened this issue Apr 12, 2017 · 39 comments
Closed

Cannot Login with AD user #27

amalcp opened this issue Apr 12, 2017 · 39 comments

Comments

@amalcp
Copy link

amalcp commented Apr 12, 2017

Hi ,

I have installed and configured PowerBroker Identity Services Open 8.5.0.153 successfully but I cannot login to the ubuntu desktop using the AD user.

Then I have issued a command

$ domainjoin-cli query

I got

Name = acp-box16
Domain = DOMAIN.LOCAL
Distinguished Name = CN=ACP-BOX16,CN=Computers,DC=DOMAIN,DC=local

Also, the computer name is added to the active directory.

I'm not sure why I cannot login to the desktop with this AD user.

Should I configure anything on AD itself or? Any help will be appreciated.

Thanks
Amal

@RBoulton-BT
Copy link
Contributor

RBoulton-BT commented Apr 12, 2017

Running "pbis status" will give you an indication of whether the agent is joined correctly and able to communicate with AD.

If that looks good I'd check that "id domain\\user" command returns information you'd expect for your user.

You can also use the "pbis authenticate-user" command to confirm the actual underlying authentication is successful.

I think /var/log/messages is the default log location so you may also see something useful there.

@amalcp
Copy link
Author

amalcp commented Apr 12, 2017

Thanks for the quick reply.

I have issued pbis status and it looks good.

But,
root@acp-box16:~# id domain\user
id: ‘domainuser’: no such user

root@acp-box16:~# pbis authenticate-user --user ubuntu --domain DOMAIN.local
Password:*****
Success

Still, it saying invalid password, please ty again

I couldn't find any PBIS related issues on syslog

@RBoulton-BT
Copy link
Contributor

I keep forgetting this issues markup text loses the double \\. Make sure you're escaping your \ on the command line.

@amalcp
Copy link
Author

amalcp commented Apr 19, 2017

Appreciate your help, But I didn't get any positive response

root@acp-box16:~# id domain\user
id: ‘domainuser\user’: no such user

I have followed the below steps to AD login settings

  • sudo /opt/pbis/bin/config UserDomainPrefix ubuntu
  • sudo /opt/pbis/bin/config AssumeDefaultDomain true
  • sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
  • sudo /opt/pbis/bin/config HomeDirTemplate %H/%U
  • sudo /opt/pbis/bin/config RequireMembershipOf ubuntu\DomainUsers

I was wondering whether I have to change something on this?

@RBoulton-BT
Copy link
Contributor

I was avoiding using real usernames in case they were sensitive but this is getting confusing. So I'm not sure if your user "ubuntu" is just an example or a real user. If it's the real username and not the Netbios domain name then it shouldn't be set as UserDomainPrefix. The UserDomainPrefix is what is prepended to the username you type in, so it should be your netbios domain name.

So if your domain is DOMAIN.local with a netbios name DOMAIN, then the standard name for your AD user would be DOMAIN\ubuntu. If you set "AssumeDefaultDomain true" then you can just use ubuntu and PBIS will automatically prepend DOMAIN\. With a "UserDomainPrefix ubuntu" you will be getting ubuntu\ubuntu.

To get an idea of which users are available for logon you can either try "getent passwd" or "pbis enum-users"

@amalcp
Copy link
Author

amalcp commented Apr 19, 2017

Perfect. I got mistaken on the above commands and I have corrected with the help of your explanations.
I do really appreciate your time and support.

We, people, don't know the pbis commands like getent passwd or pbis enum-users
So, can you please help me to get basic troubleshooting commands for this AD-Linux integration? This will help me to fix issues in future

Thanks

@RBoulton-BT
Copy link
Contributor

RBoulton-BT commented Apr 19, 2017

The command "getent passwd" calls the name service switch to list all the users that the Linux system recognizes. If you type this command at the command prompt you should see your local and AD users listed with the names you need to type at the logon prompt.

The command "pbis enum-users" is similar and will list the AD users PBIS recognizes. It talks directly with the PBIS services rather than the name service switch, so if this works but getent passwd doesn't we know there's an issue with the integration.

@dodinh
Copy link

dodinh commented May 30, 2017

We have the same problem:

  • pbis status shows it is connected
  • pbis authenticate-user --user myusername works
  • id myusername: id: myusername: no such user

We have UserDomainPrefix and AssumeDefaultDomain set as well.

@dodinh
Copy link

dodinh commented May 31, 2017

When trying to connect via ssh using myusername, this gets logged in syslog:

May 31 10:39:50 myserver lsass: [LwKrb5GetTgtImpl /builder/src-git/Platform/src/linux/lwadvapi/threaded/krbtgt.c:276] KRB5 Error code: -1765328360 (Message: Preauthentication failed)
May 31 10:39:50 myserver lsass: [lsass] Failed to authenticate user (name = 'myusername') -> error = 40022, symbol = LW_ERROR_PASSWORD_MISMATCH, client pid = 15277

@AdminM1
Copy link

AdminM1 commented Jun 27, 2017

The same problem with one PC:

  • pbis status shows it is connected
  • pbis authenticate-user --user myusername works
  • id myusername -- "id: myusername: no such user"
  • getent passwd show only local users from /etc/passwd

@hatchetation
Copy link

hatchetation commented Jun 28, 2017

We're troubleshooting an intermittent issue (on 8.5.3.293) with the same symptoms: status and queries with pbis commands looks OK and normal, but users aren't seen on newly-bootstrapped servers.

The cause seems to be /etc/nsswitch.conf not being modified during the install process to activate lsass. On problematic servers, the file is stock:

# /etc/nsswitch.conf

passwd:         compat
group:          compat 
shadow:         compat

vs working:

# /etc/nsswitch.conf

passwd:         compat lsass
group:          compat lsass
shadow:         compat

Manually adding lsass to passwd & group and restarting will reliably fix the issue.

Our bootstrap process is highly automated (cloud VMs), so I'm not sure what the root cause may be. Yesterday, everything worked fine. Today (same vanilla base ubuntu 14.04 image, same configuration/automation), all servers so far are failing.

Perhaps there's some interaction with external systems during the install process which can silently timeout, or is timing dependant in some other way? Captured output looks entirely ordinary, all commands succeed with exit code of zero.

@bartwallace
Copy link

I'm having similar issue with version 8.5.4.334 amd64.

uname -a

cat /etc/nsswitch.conf
`# /etc/nsswitch.conf
passwd: compat lsass
group: compat lsass
shadow: compat
gshadow: files

hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis
`
pbis status - shows it is connected
pbis authenticate-user --user myusername --domain mydomain - works
id myusername -- "id: myusername: no such user"
id msrs\myusername - works
getent passwd shows all AD users

@sfitsp
Copy link

sfitsp commented Jul 10, 2017

hello everyone
I'm also facing same issue I followed the following steps on fresh install Ubuntu

  • 16.04.

1 apt-get upgrade
2 apt-get dist-upgrade
3 reboot
4 nano /etc/avahi/avahi-daemon.conf
5 apt-get install ssh
6 wget -O - http://repo.pbis.beyondtrust.com/apt/RPM-GPG-KEY-pbis|sudo apt-key add -
7 wget -O /etc/apt/sources.list.d/pbiso.list http://repo.pbis.beyondtrust.com/apt/pbiso.list
8 apt-get update
9 apt-get install pbis-open
10 service avahi-daemon restart
11 sudo domainjoin-cli join smdomain.com administrator #close domainjoin-gui
12 service ssh restart
13 /opt/pbis/bin/config UserDomainPrefix smdomain
14 /opt/pbis/bin/config AssumeDefaultDomain true
15 /opt/pbis/bin/config LoginShellTemplate /bin/bash
16 /opt/pbis/bin/config HomeDirTemplate %H/%U
17 /opt/pbis/bin/config RequireMembershipOf smdomain\linux
18 nano /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
19 reboot

and after reboot I wasn't able to login with domain credential so I logged in back through local system user and run command "pbis status" it shows unknown then I tried it by restarting "lwsmd service" and the miracle is pbis status shows online, I have logged off from local user and login through domain user successfully BUT
after every restart I'm doing same thing...

is there any permanent solution?????

I hope you'll help,
please help.. your help will highly appreciated!
Thank you !!!

@rbest-bt
Copy link
Contributor

I'm able to reproduce this issue and I'm investigating

@sfitsp
Copy link

sfitsp commented Jul 11, 2017

@rbest-bt Thanks for the instant help.. I'm also trying,, please let me know if it's solved

@bartwallace
Copy link

I discovered after a reboot and upgrade that my /opt/pbis/bin/config settings were not set. I reset those configs and have been good since. I would check those and make sure they are written properly.

@rbest-bt
Copy link
Contributor

When it's in a bad state check out the lwsmd status.
systemctl status lwsmd.service

If there is an enumeration error, then add trustEnumerationWait to your domainjoin command
sudo domainjoin-cli join --trustEnumerationWaitSeconds 30 smdomain.com administrator

See Issue #6 for more information

@rbest-bt
Copy link
Contributor

rbest-bt commented Jul 11, 2017

Note to everyone: There is an option in the domainjoin command to set assumeDefaultDomain. Saves you from needing to set it via config tool
domainjoin-cli join --assumeDefaultDomain yes --trustEnumerationWaitSeconds 30 domain.local administrator

@sfitsp
Copy link

sfitsp commented Jul 11, 2017

Yes I have seen Issue #6 but not solved see the output systemctl status lwsmd.service
screenshot from 2017-07-12 00-09-01

@rbest-bt
Copy link
Contributor

try adding more time to trustEnumerationWaitSeconds. 45 or 60 seconds

@rbest-bt
Copy link
Contributor

@dodinh LW_ERROR_PASSWORD_MISMATCH can get generated when you enter the correct password but ssh does not like a setting of the user. This is a known issue in ssh and I've seen it when the users shell is not available on the system.

@sfitsp
Copy link

sfitsp commented Jul 11, 2017

Thank you so much @rbest-bt
I think my issue is resolved I have tried and restarted couple of times and its showing the domain users that I logged.. what was the causes can you please share?

@rbest-bt
Copy link
Contributor

We have an issue with systemd between the lwsmd and network services starting. lwsmd is trying to enumerate the domain before the network is up. We are still investigating a solution that will account for offline machine. trustEnumerationWaitSeconds is just adding a set delay.

@sfitsp
Copy link

sfitsp commented Jul 11, 2017

the issue is still there

screenshot from 2017-07-12 02-08-51

@flegance
Copy link

flegance commented Jul 11, 2017

Having a similar issue as @dodinh : getting LW_ERROR_PASSWORD_MISMATCH in the lsass logs, in the same time, pbis authenticate-user works just fine, as well as id username. Seems like the issue is related to ssh not able to create a session for the user, like @rbest-bt described above, just don't know how to troubleshoot this issue

@rbest-bt
Copy link
Contributor

@sfitsp - Try increasing the trustEnumerationWaitSeconds again. We are looking into a better solution in Issue 6

@flegance - please create a new issue for this. For now try and confirm the users environment and make sure their options are available. Also increase the logging on lsass. Wait to log the issue till later today as I'm working on a template for logging issue.

@flegance
Copy link

flegance commented Jul 12, 2017

thank you, @rbest-bt . We just got the issue resolved, hence I'm not going to create a new one for this. The issue was with /etc/ssh/sshd_config - we had AllowedUser setting configured and it was restricting everybody else. The way we found it out - looked into the /var/log/secure log, and saw this:
User %username% from %hostname% not allowed because not listed in AllowUsers
input_userauth_request: invalid user
we already had lsass in the debug logging level, and the only thing we were getting from it was:
pre-authentication failed and LW_ERROR_PASSWORD_MISMATCH
which was pretty misleading.
So, you were right about checking other options as PBIS was configured properly
To resolve the issue, we removed (commented) the AllowedUser in sshd_config and were able to log in right after that

@sfitsp
Copy link

sfitsp commented Jul 13, 2017

@rbest-bt Thank youi It's working but I think its not a proper solution because we have wait for login and sometimes needs to restart...

@rbest-bt
Copy link
Contributor

Yes we are working on a better fix. Follow Issue 6 for updates

@sfitsp
Copy link

sfitsp commented Jul 20, 2017

team the following error shows by lwsmd

Jul 21 01:18:29 ubuntu lsass[905]: [lsass] Fatal error enumerating trusts for domain SMDOMAIN.COM. Error was ERROR_GEN_FAILURE (31)

@vijesh-raj
Copy link

HI all,

I have a domain controller installed with 2016 server and having ubuntu\windows machines as clients. I have integrated ubuntu machines using PBIS. My question is what can I apply the same group policy configured over domain controller to Ubuntu machines? Or do I need to have more configurations on PBIS

@rbest-bt
Copy link
Contributor

Refer to answer in #129

@pankaj9492
Copy link

I am facing error, can you please have look.....i am using over ubuntu 18

unicode@client1:~$ sudo /opt/pbis/bin/domainjoin-cli --loglevel info --logfile . join UNICODESYSTEMS.IN Administrator
20190116194506:INFO:Domainjoin invoked with the join command (remaining arguments will be printed later):
20190116194506:INFO: [/opt/pbis/bin/domainjoin-cli]
20190116194506:INFO: [--loglevel]
20190116194506:INFO: [info]
20190116194506:INFO: [--logfile]
20190116194506:INFO: [.]
20190116194506:INFO: [join]
20190116194506:INFO:Validating join options.
20190116194506:INFO:Domainjoin invoked with 2 arg(s) to the join command:
20190116194506:INFO: [UNICODESYSTEMS.IN]
20190116194506:INFO: [Administrator]
20190116194506:INFO:Adding client10 (fqdn client10.unicodesystems.in) to /etc/hosts ip 127.0.1.1, removing client10, client10.unicodesystems.in, client10, client10.unicodesystems.in
20190116194506:INFO:Reading krb5 file /tmp/likewisetmpIGeNFj/etc/krb5.conf
20190116194506:INFO:Reading nsswitch file /etc/nsswitch.conf
20190116194506:INFO:Reading krb5 file /tmp/likewisetmpWlSUFQ/etc/krb5.conf
20190116194506:INFO:Distro Version 18.04
20190116194506:INFO:Found config file /etc/ssh/sshd_config
20190116194506:INFO:Found binary /usr/sbin/sshd
20190116194506:INFO:Reading ssh file /etc/ssh/sshd_config
20190116194506:INFO:Found open sshd version 7.6.-1p1
20190116194506:INFO:Testing option ChallengeResponseAuthentication
20190116194506:INFO:Testing option UsePAM
20190116194506:INFO:Testing option PAMAuthenticationViaKBDInt
20190116194506:INFO:Option PAMAuthenticationViaKBDInt not supported
20190116194506:INFO:Testing option KbdInteractiveAuthentication
20190116194506:INFO:Testing option GSSAPIAuthentication
20190116194506:INFO:Option GSSAPIAuthentication supported
20190116194506:INFO:Testing option GSSAPICleanupCredentials
20190116194506:INFO:Found config file /etc/ssh/ssh_config
20190116194506:INFO:Found binary /usr/bin/ssh
20190116194506:INFO:Reading ssh file /etc/ssh/ssh_config
20190116194506:INFO:Testing option GSSAPIAuthentication
20190116194506:INFO:Option GSSAPIAuthentication supported
20190116194506:INFO:Testing option GSSAPIDelegateCredentials
20190116194506:INFO:Option GSSAPIDelegateCredentials supported
Joining to AD Domain: UNICODESYSTEMS.IN
With Computer DNS Name: client10.unicodesystems.in

Administrator@UNICODESYSTEMS.IN's password:
20190116194512:INFO:Using user entered password
20190116194512:INFO:Running module join

Error: ERROR_CONNECTION_REFUSED [code 0x000004c9]

20190116194526:ERROR:ERROR_CONNECTION_REFUSED [ERROR_CONNECTION_REFUSED]

Stack Trace:
/builder/src-git/Platform/src/linux/domainjoin/domainjoin-cli/src/main.c:1640
/builder/src-git/Platform/src/linux/domainjoin/domainjoin-cli/src/main.c:894
/builder/src-git/Platform/src/linux/domainjoin/libdomainjoin/src/djmodule.c:356
/builder/src-git/Platform/src/linux/domainjoin/libdomainjoin/src/djauthinfo.c:858
/builder/src-git/Platform/src/linux/domainjoin/libdomainjoin/src/djauthinfo.c:1271

@rbest-bt
Copy link
Contributor

I would confirm the domain is resolving to the correct DC IP. If you need more assistance please open a new issue.

@pankaj9492
Copy link

yes domain is resolving

unicode@client1:~$ nslookup

192.168.1.232
232.1.168.192.in-addr.arpa name = ad.unicodesystems.in.
unicodesystems.in
Server: 192.168.1.232
Address: 192.168.1.232#53

Name: unicodesystems.in
Address: 192.168.1.232

ad.unicodesystems.in
Server: 192.168.1.232
Address: 192.168.1.232#53

Name: ad.unicodesystems.in
Address: 192.168.1.232

^Cunicode@client1:~$

image

@Mohiyoddin
Copy link

Mohiyoddin commented Jan 23, 2019

I am working as system admin and this is the best way for joining domain. here you can find the full installation file with setup by setup. download the pbis file and save it in download folder.

Installation of PBIS and joining domain in ubuntu 14.04 & 16.04 ( may be work for 18.04)

  1. sudo apt-get update

  2. sudo apt-get upgrade

  3. sudo apt-get install ssh

  4. Download the file and save it in downloads folder

  5. cd Downloads/

  6. sudo chmod +x pbis-open-8.0.0.2016.linux.x86_64.deb.sh or ( file name )

  7. sudo ./pbis-open-8.0.0.2016.linux.x86_64.deb.sh (or file name)

       (In ubuntu 18.04 change 'nameserver ip' not for ubuntu 14.04 & 16.04 version)
    

for ubuntu 18.04 only

    • sudo nano /etc/resolv.conf

nameserver ( your domain server IP )
search ( your domain name )

    • sudo domainjoin-cli join dom.example.com Administrator ( close GUI login )

my domain name is - example
and full name - dom.example.com

    • sudo /opt/pbis/bin/config UserDomainPrefix example
    • sudo /opt/pbis/bin/config AssumeDefaultDomain true
    • sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
    • sudo /opt/pbis/bin/config HomeDirTemplate %H/%U
    • sudo apt-get update
    • sudo nano /etc/pam.d/common-session

*change the line that reads:

session sufficient pam_lsass.so

to

session [success=ok default=ignore] pam_lsass.so

if its not found the (session sufficient pam_lsass.so) run this command

    • sudo pam-auth-update

Finally edit lightdm configuration file by executing the following command

    • sudo nano /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf

delete everything and add this lines.

[SeatDefaults]
greeter-session=unity-greeter
allow-guest=false
( 8 space ) greeter-show-remote-login=false
( 8 space ) greeter-show-manual-login=true

if you got error - "no user found" just run this command.

    • sudo service lwsmd restart

add this command extra for ubuntu 16.04

    • sudo nano /etc/default/grub

find this

GRUB_CMDLINE_LINUX=""

change this to

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

    • sudo update-grub
    • sudo reboot

Uninstalling PBIS

    • sudo /opt/pbis/bin/domainjoin-cli leave
    • sudo /opt/pbis/bin/uninstall.sh uninstall

@pankaj9492
Copy link

pankaj9492 commented Jan 23, 2019 via email

@rbest-bt
Copy link
Contributor

We hope to add greeter-show-manual-login=true in to part of the install process in the future. This is something that impacts ubuntu only.

I would like to know the problem that is getting addressed with:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

@Mohiyoddin
Copy link

Mohiyoddin commented Feb 12, 2019

What error are you getting?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests