[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] RHEL userid puzzlement
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] RHEL userid puzzlement |
Date: |
Wed, 11 Sep 2019 15:03:23 +0200 |
On Wed, 11 Sep 2019 00:05:55 +0000 Greg Chicares <address@hidden> wrote:
GC> Vadim--Can you help us figure out what's going wrong here?
Unfortunately, I'm afraid that even though I can more or less deduce
what's going wrong, I can't help you with fixing it.
GC> [XXX:YYY]/home/YYY$ sudo grep YYY /etc/passwd
GC> [XXX:YYY]/home/YYY$
GC> [XXX:YYY]/home/YYY$ whoami
GC> YYY
GC>
GC> AFAICT that boils down to
GC> sudo grep `whoami` /etc/passwd
GC> which I should think would necessarily work.
This depends on the system configuration, /etc/passwd is just one of the
possible sources of the user database and I guess this system uses
something different, e.g. an LDAP or a NIS server. You should be able to
find more about this by looking at /etc/nsswitch.conf and/or
/etc/libuser.conf files.
GC> Okay, we've become root, so we have the power to
GC> change the shell for any user we can name...but
GC> our name doesn't seem to be XXX:YYY or YYY either:
GC>
GC> [XXX:YYY]/home/YYY$ sudo chsh -s /bin/zsh XXX:YYY
GC> chsh: user "XXX:YYY" does not exist.
GC> [XXX:YYY]/home/YYY$ sudo chsh -s /bin/zsh YYY
GC> Changing shell for YYY.
GC> chsh: user "YYY" does not exist.
The difference between the 2 errors is interesting. I think it shows that
"YYY" is the valid user name locally, but somehow is not found in the
actual user database.
GC> [XXX:YYY]/home/YYY$ whoami
GC> YYY
GC> [XXX:YYY]/home/YYY$
GC> [XXX:YYY]/home/YYY$ chsh -s /bin/zsh YYY
GC> Changing shell for YYY.
GC> Password:
GC> chsh: user "YYY" does not exist.
GC> [XXX:YYY]/home/YYY$
GC>
GC> How can user `whoami` not exist? What am I missing?
I don't know if this is normal or if the system is misconfigured, but in
any case I don't think you have the rights to do anything about it, as the
actual user information is not stored on it, but somewhere else.
A quick web search shows that there is a special "lchsh" command in RedHat
which is supposed to work on a properly configured system, so perhaps you
could try this one?
Otherwise, I can only recommend putting "exec zsh" (preferably after
verifying that it's available!) in your ~/.bash_login, e.g. something like
this:
if hash zsh 2> /dev/null; then
exec zsh -l
fi
Regards,
VZ
pgpcM4r9f_ke1.pgp
Description: PGP signature