On 05Mar2018 18:38, Ranjan Maitra <maitra@xxxxxxxxx> wrote:
I am on a single-account F27 system with an user id 1000. I want to change
this user id. From what I understand, I should do the following:
sudo usermod -u 54321 <username>
However, when I do this, I get:
usermod: user <username> is currently used by process 866
usermod might have some kind of -f (force) option. Or maybe not, see the
manual.
I guess that this has to do with the fact that I am logged in (to do this). How do I get around this point? There is no root on the system but I do have sudo access.
On a single user system the accounts are usually defined by the /etc/passwd
file (and /etc/shadow etc). So you could run:
sudo vipw
and edit your user id in the passwd file directly.
Separately, I want all my files and directory owned by 1000 to move to this user id (so that I can have access)? Is this automatic or do I have to run chown -R <username> etc?
I would run chown myself. You also need to look in the mail spool.
chown -R 54321 ~your_username
Note the "~", you need to hand your home directory path to the chown command.
Of course, after the "vipw" step you could just say:
chown -R your_username ~your_username
because that should look up your new id.
There may be more files in a few places in the system (really, very few).
/var/spool/mail might have a mail file.
Running:
find /var -user 1000 -ls
might be illuminating.
If you have NFS mounted directories in which you have made files, you will need
to go after them also, and so forth.
Cheers,
Cameron Simpson <cs@xxxxxxxxxx> (formerly cs@xxxxxxxxxx)
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx