Users, modifying
LionKimbro (Talk | contribs) (groups) |
|||
Line 3: | Line 3: | ||
To change a user's shell, use [[chsh]] or [[pw]] '''usermod [username] -s [path to new shell]'''. | To change a user's shell, use [[chsh]] or [[pw]] '''usermod [username] -s [path to new shell]'''. | ||
− | To change a user's name, edit [[ /etc/passwd]]. | + | To change a user's name or primary group, edit [[ /etc/passwd]]. |
To change a user's login name (account name,) you can edit [[ /etc/passwd]] and [[ /etc/master.passwd]] and recompile them using [[pwd_mkdb]], but another easy (and safe!) way to do it is to add a new user and move the user's files over to the new user and chmod and chown everything to that new user. | To change a user's login name (account name,) you can edit [[ /etc/passwd]] and [[ /etc/master.passwd]] and recompile them using [[pwd_mkdb]], but another easy (and safe!) way to do it is to add a new user and move the user's files over to the new user and chmod and chown everything to that new user. | ||
− | To change the user's groups, edit [[/etc/group]]. [http://www.freebsd.org/doc/en/books/handbook/users-groups.html] | + | To change the user's member groups, edit [[/etc/group]]. [http://www.freebsd.org/doc/en/books/handbook/users-groups.html] |
[[Category:Common Tasks]] | [[Category:Common Tasks]] |
Latest revision as of 15:09, 8 December 2007
There are many ways to modify existing users on your system, depending on what you want to do; you can even edit the relevant files manually, but beware: the actual files referenced by the system aren't the plaintext editable files, they're compiled database files, so you'll need to use pwd_mkdb if you try to edit /etc/master.passwd directly.
To change a user's shell, use chsh or pw usermod [username] -s [path to new shell].
To change a user's name or primary group, edit /etc/passwd.
To change a user's login name (account name,) you can edit /etc/passwd and /etc/master.passwd and recompile them using pwd_mkdb, but another easy (and safe!) way to do it is to add a new user and move the user's files over to the new user and chmod and chown everything to that new user.
To change the user's member groups, edit /etc/group. [1]