LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2021, 03:44 PM   #1
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Rep: Reputation: 2
New user + NIS server: login fails on other servers


Hello!

I'm attempting to add a new user name at work. We have a NIS server administering host names
and users. I've run "adduser <new_user_name>", run "passwd" to set its initial password,
copied the added lines from /etc/passwd (on the NIS server) to the input files at /var/yp/etc
(and checked that the Makefile really uses the directory "/var/yp/etc" as input), run "make passwd"
in the "/var/yp" directory, stopped and restarted the "ypserv", also stopped and restarted
"ypbind" on another server. I also removed the new user lines from the /etc/passwd and /etc/shadow
files on the NIS server.


When I run "su <new_user_name>" on the NIS server, I can login OK and "whoami"
shows <new_user_name>. However, on other servers, even if I see the new user line in the
output of "ypcat passwd", an attempt to "su <new_user_name>" results in password not being
recognized.



the "passwd" lines in the /etc/nsswitch file (of the other, non NIS server) are:

Code:
passwd: files nis sss
shadow: files nis sss
group:  files nis sss

What am I doing wrong?

TIA!
 
Old 11-14-2021, 11:32 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Is there an entry for the user in /var/yp/etc/shadow with the hashed password?
 
Old 11-15-2021, 01:20 AM   #3
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Original Poster
Rep: Reputation: 2
Yes, there is.

I only run "make passwd", should I also run "make shadow" or the "shadow" file
contents are taken into account by "make passwd" command? Inside the "Makefile"
I see "passwd" and "shadow" listed on the same line with other results to make.

TIA!
 
Old 11-15-2021, 01:45 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,688

Rep: Reputation: Disabled
Why won't you just run make without any arguments? It will update only those maps where the source is newer.
Code:
make -C /var/yp
 
Old 11-15-2021, 01:35 PM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,849

Rep: Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224
Or
Code:
cd /var/yp
make
 
Old 11-16-2021, 05:44 AM   #6
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Original Poster
Rep: Reputation: 2
Thanks to all replies,
we finally figured out (well, worked around) the problem: it seems
manual adding of lines with new username in /var/yp/etc/passwd and /var/yp/etc/shadow was the problem:
after creating a slightly differently named user name (the user is OK with it) and copying
the /etc/passwd, /etc/shadow to /var/yp/etc and rerunning "make passwd", restarting the "ypserv" on the NIS server
and restarting the "ypbind" on other servers we finally can "su new_user_name1".

Now we have a relatively smaller problem of "su new_user_name1" doesn't start at new $HOME directory (but "echo $HOME"
produces it correctly and "cd" without arguments also gets to $HOME), hope to solve it soon.
 
Old 11-17-2021, 12:49 AM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,849

Rep: Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224
Code:
su - new_user_name1
The dash emulates a login and changes directory.

Try also
Code:
sudo -su new_user_name1
sudo -iu new_user_name1
The latter emulates a login.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to login to NIS client machine(Ubuntu) using NIS login user name crazymoonboy Linux - Server 10 05-08-2015 07:28 AM
how the NIS information will propagate fron NIS master to NIS slave & vicevarsa? dezavu Linux - Server 5 10-14-2011 03:08 AM
only limited users should login in NIS (not all nis users) RHEL 5.4 kingston Linux - Newbie 1 08-01-2011 12:16 PM
NIS: NIS running but users not able to log in with NIS credentials outerspace Linux - Server 3 10-17-2007 08:51 AM
NIS Client can not login to NIS Master Server Free_beer Ubuntu 3 10-09-2006 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration