Unix OS Managing Users/Groups from the Command Line

** Web
Managing Group from the Command Line
Commands for Managing Groups:
# groupadd -g 500 accts
# groupmod -n accounts accts
# groupdel accounts
# vi /etc/group
# grpck
# groupadd -g 500 accts
Create a group called accts with GID 500.
# groupmod -n accounts accts
Change the name of accts to accounts.
# groupdel accounts
Delete the accounts group.
Managing Users from the Command Line
Commands for Managing User Accounts:
# useradd -m –d /home/user1 -k /etc/skel –u 100 –g 500 –s /bin/ksh user1
# useradd -m user1
# usermod -G finance user1
# userdel -r user1
# passwd user1
# vipw
# pwck

-m Home directory.
-k /aaa/skel Define the skeleton directory copied to home.
-u 101 Use userid 101.
-g 500 Define the user's primary group.
-G finance,accounts Define the user's other group memberships.
-c "111-1111" Define the user's comment field in /etc/passwd.
-d /home/guest Define the user's home directory.
-s /usr/bin/csh Define the user's default login shell.
–o Allows the creation of users with non-unique userid's.
The /etc/skel Directory /etc/skel/.profile,.login,.cshrc copied to new accounts /home/user1,.profile,.login,.cshrc



0 comments:

Loading