Linux - NetworkingThis 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.
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.
Or you could just change them, it's not terribly difficult. Those UID/GID were chosen by the system because you LET IT choose them. This is one of those instances where if you need the UID/GID to be set explicitly, then you need to set it explicitly, you shouldn't just sit back and hope that the system automatically chooses the correct values, because 99.99% of the time it won't (it doesn't know the context, there's no way for it to know what the correct values would be).
Log out of the machine, switch to a TTY (Ctrl + Alt + F2-6), log in as root. Use "w" to confirm the user account is not logged in, unmount all of your NFS mounts, and then run the following:
Code:
usermod -u newID "user"
groupmod -g newID "group"
find / -user oldID -exec chown newID {} \;
find / -group oldID -exec chgrp newID {} \;
Where "user" and "group" are the user/group names, oldID is the old ID (UID or GID, as the case may be), and newID is the new ID.
This will change the user's ID to what you tell it, and then find any files on the system matching the old ID and switch them to the new ID. You'll also need to change the default group for your user to the new GID.
Once it's done, log back in and you're good to go. Run this on each machine and each user where it's a problem, and you'll be fixing the issue at its source without any hacks or work-arounds. And in the future, if you know you'll be using NFS, then pay attention to UID/GID when setting up new users. Every Linux system I've used lets you specify the UID/GID when setting up a new user, it only "randomly picks one" when you don't bother to set it.
Last edited by suicidaleggroll; 09-20-2014 at 09:22 AM.
However, if I try to do the same with my other NAS (DNS-325), I must be absolutely sure that it goes right.
Are there some UID GID ranges that I should avoid using? (i.e. reserved for system processes)
Unfortunately every OS is different in that regard. I think it's probably pretty safe to assume that any ID not currently in use on a NAS system is not going to be used, since it's not like you or anyone else is going to be going around setting up new services on a dedicated NAS box. However I can't be 100% sure about that.
Unfortunately every OS is different in that regard. I think it's probably pretty safe to assume that any ID not currently in use on a NAS system is not going to be used, since it's not like you or anyone else is going to be going around setting up new services on a dedicated NAS box. However I can't be 100% sure about that.
That is not so good news. I'm planning to set-up new services on my new NAS.
lighttpd, openvpn, squid, twonky, transmission, subversion, rsync, are in the pipeline.
By the way I see what you mean, sshd has different UID:GID on two NAS stations.
I think for most sane distros anything not already in use above 1000 is safe.
Also, for most sane distros and embedded systems, the bottom of the range, 0...> is used for special UIDs/GIDs, system services, etc. zero being root by definition. For a NAS I would imagine that would stay below a hundred or so.
Of course as the eggroll says, you can only really tell by looking.
For my own machines and users, I maintain a central makeusers script that I use to create or add all users and groups to system under my care.
It is fairly simple and simply defines a list of users, groups and their UID/GID, and any default options such as home path, shell, nologin, etc. When I install a new machine or need to add a user or group to an existing one, I comment out or add new entries as needed, copy it over then run it.
My script does not currently check whether one already exists, have intended to add that to it... but for a few dozen entries it is really not difficult to manage - you don't add or change users every day (at least I don't...).
Today I have migrated UID and GID on my Ubuntu system, but it is not 100% success.
I performed the very same procedure that I normally do on my Fedora system.
After reboot I can still log-in as user "boris". Besides a slightly different log-in screen (no user is pre-selected, no usual background), everything else seems to be normal. Then I noticed that the User Profile (in System Settings > User Accounts) has completely disappeared. (see the screen-shot)
There used to be something like this before > screen-shot.
I have chosen 502:702 because my NAS and Fedora machine are both using these values (also yesterday I successfully migrated my 2nd NAS to these values).
Ubuntu is somehow different, I do not understand why. I did check before performing this operation, neither UID=502 nor GID=702 are being used by the system.
I'm planning to add more Ubuntu users to experiment with this until I get it right.
Some advice would be more than welcome.
What step(s) am I missing? Any suggestions?
Although the procedure failed for Ubuntu, I thrust this solution based on successful implementation on Fedora and DNS-325 NAS. Therefore I'm marking this thread as solved.
I don't use Ubuntu, so I can't really comment on why it didn't work there, though I have done this extensively on Fedora, CentOS, RHEL, and OpenSUSE. Maybe there was something about the UID/GID you were attempting to use on that Ubuntu box?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.