I'd be rather careful with modifying users on existing system - unless
you know exactly what you are doing. It can have pretty nasty side
effects appearing/re-appearing and entertaining you for long time to
come, at the 'best' possible times.

Local users and file ownership in Linux is established by UID.
User name is just a name for UID on a particular system.
  * so if you change user name (not UID), nothing has really changed
beside the user name displayed on given host.
  * if you see file owned by dick - there must be a user for that UID
with name dick on your system, otherwise you would see familiar nobody.
  * so based on UID on a particular systems you could be rsteff on
both, but with different UIDs. So when you copy those files -
preserving UID, you lose ownership and the new owner becomes someone
else or Mr/Mrs nobody.

When you use rsync to copy stuff between systems - the ownership gets
translated.
When you use NFS mounts (v3 or newer) between systems, the ownership
gets translated too as long as there are matching user names on all
connected hosts.

So as you can guess - it is good idea to follow bunch of rules when
managing a herd of standalone linux hosts without centralized user
management:
1. Synchronize UIDs and user names across all hosts.
   You do not have to have all users on all hosts, but their UIDs and
user name pairs should match.
  It is good practice to replicate users though an disable them when
needed, so that their old files still have an owner.
2. Synchronize GIDs and group names across all hosts - for precisely
the same reasons as 1.

Forward looking thoughts:
-------------------------
Following these two rules will make your shepherd's (no pun intended)
life much easier. Although following these rules across your herd can
get pretty tedious over time - leading some shepherds to use central
user, group, host, .... management such as LDAP or FreeIPA (mentioned
here a few weeks ago). That combined with networked storage makes
computers orders of magnitude more useful.

Having central user management (AKA information services) and
associated DNS, NFS, DHCP, etc. used to be pretty expensive proposition
from IT, electricity and man power cost. This is no longer the case
with the advent of RaspberryPi type of computers which cost almost
nothing in IT and electricity cost and are pretty easy to connect to
your network and forget about them. RPi type computers also enable
pretty cheap/easy redundancy and backup - which is a must with
centralized services - because when they go down everything tends to
get stuck. Pulling another RPi from your drawer with identical setup to
the old one, and saving the day, makes you feel pretty darm good about
yourself.

Tomas

On Thu, 2018-05-17 at 16:26 -0700, Dick Steffens wrote:
> On 05/17/2018 04:21 PM, Rich Shepard wrote:
> > On Thu, 17 May 2018, Dick Steffens wrote:
> > 
> > > That part I know. What I've never looked into is how to change
> > > the 
> > > name of user dick to user rsteff, not from a file ownership 
> > > perspective, but from who is logged in. I'm sure I could create 
> > > another user named rsteff, but I don't think that's what I mean
> > > to 
> > > do, either.
> > 
> > Dick,
> > 
> >   Perhaps this will help:
> > <https://askubuntu.com/questions/34074/how-do-i-change-my-username#
> > 34075>
> > 
> >   For details, 'man usermod(8)':
> > 
> > NAME
> >        usermod - modify a user account
> > 
> > SYNOPSIS
> >        usermod [options] LOGIN
> > 
> > DESCRIPTION
> >        The usermod command modifies the system account files to 
> > reflect the
> >        changes that are specified on the command line.
> >   ...
> > 
> > -l, --login NEW_LOGIN
> >            The name of the user will be changed from LOGIN to
> > NEW_LOGIN.
> >            Nothing else is changed. In particular, the user's home 
> > directory
> >            or mail spool should probably be renamed manually to 
> > reflect the
> >            new login name.
> > 
> > HTH,
> > 
> 
> Thanks. That's probably what I need.
> 
_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to