0% found this document useful (0 votes)
3 views2 pages

User and Group Management Commands

The document outlines the creation of user accounts and group memberships, specifically a group named 'devgrp' with users Alex, Harry, and Jarnes, each having specific permissions and password settings. It also details the configuration of a cron job for user Harry to log the date every 30 seconds into a file, and the addition of user Tom with read permissions on that file. Commands for each action are provided for execution in a Linux environment.

Uploaded by

Abcd591177
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

User and Group Management Commands

The document outlines the creation of user accounts and group memberships, specifically a group named 'devgrp' with users Alex, Harry, and Jarnes, each having specific permissions and password settings. It also details the configuration of a cron job for user Harry to log the date every 30 seconds into a file, and the addition of user Tom with read permissions on that file. Commands for each action are provided for execution in a Linux environment.

Uploaded by

Abcd591177
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

 Create the user. groups.

and group membership


1. A group named devgrp
2. user Alex will update password on next login using chage cmd
3. A user Alex who belongs to devgrp as a secondary group,
4. A user Harry who also belongs to devgrp as a primary group
5. A user Jarnes who does not have access to an interactive shell on the system, and who is not a
member of devgrp.
6. Alex. Harry and James should all have the password of shadow.

Commands

1. sudo groupadd devgrp


2. sudo useradd -m -s /bin/bash -G devgrp Alex
3. sudo passwd Alex
4. sudo chage -d 0 Alex
5. sudo useradd -m -s /bin/bash -g devgrp Harry
6. sudo passwd Harry
7. sudo useradd -m -s /bin/nologin James
8. sudo passwd James
9. sudo passwd -d Alex
10. sudo passwd -d Harry
11. sudo passwd -d James

 The User Harry must configure a cron job that runs every 30 sec
and executes the date cmd and take the output in a
/home/datetxt file.

Commands
1. crontab –e
2. * * * * sleep 30 && date >> /home/datetxt
3. sudo service cron restart
 Add the user Tom and give read permission on /home/datetxt
file using setfacl cmd.

Commands
1. sudo useradd –m -s /bin/bash Tom
2. sudo apt-get update
3. sudo apt-get install acl
4. sudo setfacl -m u:Tom:r /home/datetxt

You might also like