Will changed username propagate to file permissions?

1

0

I ran lastb and found login attemps that used my username. I doubt they would guess my password, but my 4-lowercase-letter dictionary username should probably be made more complex.

I'm going to add the first letter of my last name to it with

usermod -l login-name old-name

My user belongs to 3 groups other than itself. Will those change automatically? Will ownership of files not in the home directory reflect the new login name?

EDIT: Also, will the user's group name change to match the new username? Will the change take a long time if my user has many files?

Buttle Butkus

Posted 2012-09-19T05:27:59.083

Reputation: 309

Answers

2

When using:

usermod -L login_name login

The name of the user will be changed from login to login_name. Nothing else is changed. In particular, the user's home directory name should probably be changed to reflect the new login name.

You can do that fast with

chown -R username /home/username 

Changing permissions is usually quick, even with alot of files.

You can also fix the groups with sed.

sed -i ‘s/original_word/new_word/g’ /etc/group

aviau

Posted 2012-09-19T05:27:59.083

Reputation: 123