Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
02-10-2005, 12:17 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Rep:
|
[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.
|
|
|
02-10-2005, 02:01 PM
|
#2
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Rep:
|
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.
|
|
|
02-10-2005, 08:18 PM
|
#3
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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 !)
|
|
|
02-11-2005, 09:34 AM
|
#4
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
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.
|
|
|
02-11-2005, 04:14 PM
|
#5
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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...
|
|
|
02-11-2005, 05:18 PM
|
#6
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
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.
|
|
|
02-11-2005, 08:01 PM
|
#7
|
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
|
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
|
|
|
02-11-2005, 08:10 PM
|
#8
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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?
|
|
|
02-11-2005, 08:36 PM
|
#9
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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!!!
|
|
|
02-11-2005, 09:37 PM
|
#10
|
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
|
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.
|
|
|
02-12-2005, 09:14 AM
|
#11
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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).
|
|
|
02-12-2005, 09:44 AM
|
#12
|
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
|
if you are just using one ypserver, then there shouldn't be any slaves, just hit 'ctl - d' when asked for additional servers (slaves)
|
|
|
02-12-2005, 10:19 AM
|
#13
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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.
|
|
|
02-12-2005, 10:40 AM
|
#14
|
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
|
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
|
|
|
02-12-2005, 12:05 PM
|
#15
|
LQ Newbie
Registered: Jan 2005
Location: Montreal
Distribution: Red Hat 9
Posts: 14
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:51 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|