LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2005, 12:17 PM   #1
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Rep: Reputation: 0
Red face [i have no name!] NIS NFS


Hello,

i have configured a small network (at home) with one NIS server and four clients...
The users do not exist on the host machines but the /home directories do (in this case it is /home/hoomee/ ) ...directory hoomee was created by root with 777 rights just in case.
In the /etc/passwd file of the server the original /home/$user$ as been changed to (edited)
/home/hoomee/$user$ although this directory (hoomee) is just logic on the server not "physical". When i login on a client i get the prompt : [i have no name!@client Marc]
(user Marc)

I can give more info no problem ...

Last edited by MMMarc; 02-10-2005 at 12:20 PM.
 
Old 02-10-2005, 02:01 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
You are getting "i have no name" because the users don't have an account on the server, so bash cannot resolve UID numbers to usernames (because they are not in passwd). I am not overly familiar with NIS but it would appear you have more configuration to do so that these UID numbers get mapped properly.

You can create entries in passwd, but then I presume that defeats the purpose of using NIS...

PS: please don't leave your home directories at 777, they should be 700. Also they should be owned by the user, not root.
 
Old 02-10-2005, 08:18 PM   #3
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
I won't change the home directories in /etc/passwd; it's probably disturbing UID. Our teacher insists on editing the /etc/passwd but i wonder if it's necessary (besides understanding the concept). I will also change the rights to 700 on clients, and will change the owner like you say...it's better to do things right all the time ain't it?

Thank you very much( i see you run alot of distributions !)
 
Old 02-11-2005, 09:34 AM   #4
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
You will have to make sure that the UIDs for all users match on all clients as well as on the server.
First make sure that the individual users, like Adam, have the same uid on all hosts. For this to match you will have to edit the separate /etc/passwd files. Also check to see that NIS is consulted first, before files (/etc/nsswitch.conf)

When you have made sure that all UIDs match, then check the files and their ownership. Files ownership are handled by UID, not by username, so if the UID ownership of a file is 501, then it doesn't matter whether the user is named Adam or John, this is why you will have to sync the UIDs on all systems.
 
Old 02-11-2005, 04:14 PM   #5
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
Red face

I was sure there was no point in editing the /etc/passwd files on the clients... Because if there`s alot of manipulation on the host`s then nis becomes less significant or effective, doesn`t it ? I thought the goal was to create users on the server and automatically mount them on the client's machine with maybe just one common home directory to create...

Thank you very much, when i succeed i will reply on this forum

* need to check that UID`s match...(i have none to
match since our teacher told us to create users on the server only...)

* need to put nis before files in the /etc/nsswitch file...

 
Old 02-11-2005, 05:18 PM   #6
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
The /etc/passwd files on the clients should be minimal, only specifying the necessary accounts for the linux system it self.
Most of the preparation in implementing NIS on an already running system with users is to first syncronise the UIDs on the individual hosts, so that each user has it's own UID.

Let's take it by example
Host1:
adam 501
eric 502
john 503

Host2:
eric 501
john 503

In this case you will have to decide on a UID for eric. Let us change it on host2 so that eric get's 502.
Now if eric has files on host2, then you will have to find all files owned by eric on host2 and change ownership to UID 502, or else he won't be able to read/write to them after changing to NIS. Also adam will be able to access eric's files on host2 if ownership isn't updated.

When UIDs and ownership has been fixed you can safely change to using NIS for user and group resolving.
 
Old 02-11-2005, 08:01 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
i would check out webmin: http://www.webmin.com
it has a nice easy way to setup nis servers/clients
also. on the server side, make sure to run /usr/lib/yp/ypinit -m
and make sure ypserv and yppasswd are running at startup on the server
and ypbind is being run on the clients

as for the NFS home directory?
on the server
add the following line for each client
/home *client_ip_or_name*(rw,no_root_squash)
in /etc/exports and makesure portmapper and nfs are started at startup
and on the clients, put the following line in the /etc/fstab
*server_ip_or_name*:/home /home nfs defaults 0 0
 
Old 02-11-2005, 08:10 PM   #8
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
Red face

I see! I suppose someone is happy if the users are only used per machine in a company (meaning one employee does't jump from computer to computer) but that must be rare. We would just set the UID on the server (as it is on the client) at implementation of NIS !


*So now i understand that i must edit the /etc/passwd files, on the host machines like so? example;

john : x : 503 : 503 : comments : /home/hoomee : /bin/bash

Or less than that... Name, UID only?
 
Old 02-11-2005, 08:36 PM   #9
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
Red face

Wow ! I am answering to frieza's message...I think i fell on the jackpot !

All the information i gathered is of great value and this is the cherry on top of the sunday! I can <t go without it, it seems like...

*because i never used a ypinit -m deamon (except i saw it in the green book "Linux Administration Handbook")
* the /etc/exports file was such as ; /home rw *
* i didn't get to mount properly in /etc/fstab so i auto mounted it with the /etc/rc.d/rc.local file instead...

Thanks a million times!!! i'm really getting to like this linuxquestions.org forum!!!
 
Old 02-11-2005, 09:37 PM   #10
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
you're qite welcome

here is a copy of my /etc/exports file from my server
Code:
#
/nfs         192.168.2.20(rw,no_root_squash)
/nfs	     192.168.2.8(rw,no_root_squash)
/nfs	     192.168.2.10(rw,no_root_squash)
/nfs         192.168.2.22(rw,no_root_squash)
/nfs	     192.168.2.1(rw,no_root_squash)
/nfs	     192.168.2.25(rw,no_root_squash)
/nfs	     192.168.2.9(rw,no_root_squash)
/home	     beautower(rw,no_root_squash)
/home	     beauserver(rw,no_root_squash)
/home	     beauibook(rw,no_root_squash)
/home	     mommachine(rw,no_root_squash)
/home	     testbox(rw,no_root_squash)
/home	     beauperforma(rw,no_root_squash)
and my /etc/fstab for nfs entries

Code:
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
192.168.2.5:/nfs	/nfs			nfs	defaults	0 0
192.168.2.5:/home	/home			nfs	defaults	0 0
192.168.2.25:/CHANGE_ME	/CHANGE_ME		nfs	defaults	0 0
also, the /etc/hosts file should also be exported from the nis server, so you shouldn't have to touch /etc/hosts, or the passwd file on the clients... actually once you are sure the nis is working (create a temporary account on the server only and make sure you can login on the clients with that account) i'd do a userdel of the local accounts, they will only get in the way of your nis. and again, I would reccomend you look into webmin, it provides a really nice web based frontend for otherwise complex configurations.
 
Old 02-12-2005, 09:14 AM   #11
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
Red face

I actually tested NIS for five minutes! I logged in the with four user's at the same time without the [I have no name!]
"prompt". I believe this was mainly because the /etc/exports file was fixed and the /etc/passwd file on the client was edited along with the /etc/group file... (that was the last thing being done). So after it was working i thought;

"Well maybe the reason the fstab line doesn't work (because i modified the line but still had to mount in the prompt) is because the ypinit almost a deamon thing...(newbie way of thinking)is not configured. "

So i did the /usr/lib/yp/ypinit -m thing and they asked me what was the host's or the slave's server names i am not sure...
I tried many ways (came back, modified) and it did not work at all, i can't login anymore...

Now i get this message on the client when i try to mount in the prompt with root (their are no users at all on the hosts);
"mount server.nisdomain:/home failed, reason given by server: Permission denied"

* is it because i need a slave server? (i will try configuring one, if it is like so)
* is it because there is a file to configure ypinit?
* how do i desactivate that ypinit?


Anyways, i appreciate the fact the problem has moved on...to another one! I really do...

PS: i will also edit the exports file with the same pattern, ibelieve the "nfs" is not there in my file...but the fstab file is identical (similar).
 
Old 02-12-2005, 09:44 AM   #12
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
if you are just using one ypserver, then there shouldn't be any slaves, just hit 'ctl - d' when asked for additional servers (slaves)
 
Old 02-12-2005, 10:19 AM   #13
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
That's exactly the last way i have tried yesterday, but it's still giving that message... i guess i need to reinstall RedHat9 as we would do with Windows, and start the configuration from scratch...no seriously i will try to find the problem, thanks!

Last edited by MMMarc; 02-12-2005 at 10:31 AM.
 
Old 02-12-2005, 10:40 AM   #14
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
did the clients boot with the ypserver down?
if so, try /etc/init.d/ypserv restart then ypinit -m then ypserv on the server
then on the clients... /etc/init.d/ypbind restart
 
Old 02-12-2005, 12:05 PM   #15
MMMarc
LQ Newbie
 
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14

Original Poster
Rep: Reputation: 0
Red face

I tried what you just wrote and there is nothing to do, i don't manage this ypinit at all, plus i'm suprised we don't see ypinit in class...i think the teacher is not to fond of NIS, he said many negative things about it...

I am tempted by reinstalling RedHat9 and reconfiguring everything, inspired by this forum, except for the ypinit part, and i figure it will work...(it will be good enough for the class project that is...)

Last edited by MMMarc; 02-12-2005 at 01:50 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
I need Help on NIS and NFS srikanthrao_d Linux - Hardware 9 01-22-2006 08:04 PM
(I have no name!)NIS,NFS MMMarc Linux - Software 0 02-08-2005 06:42 PM
NFS, NIS, and Fedora 2 jmoody Fedora 2 06-23-2004 05:50 AM
NIS NFS and KDE phatality Linux - Networking 2 05-26-2004 09:32 AM
NIS/NFS Thru or Around Firewall - Suggestions? Jefficus Linux - Networking 2 03-25-2004 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:51 AM.

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