plz EXPLAIN AND show me the screenshot how TO DO THESE!
Perform all of the following on your Linux instance.
For credit on this assignment, upload one or more screenshots showing all of the following.
1. To create a new user in Linux, type the following command in the Linux terminal -
sudo useradd ava
This command adds ava as a user.
2,3. Similarly add users - charlie and automation
sudo useradd charlie
sudo useradd automation
4. To create a new group in Linux use the following command - sudo groupadd marketing
This command adds a new group named marketing in Linux.
5. Similarly add the sales group - sudo groupadd sales
6. To add a user to a new group we use the adduser command. To add ava to the marketing group, the command is- sudo adduser ava marketing
7. To add charlie to the sales group, the command is - sudo adduser charlie sales
8. We can change the hostname by hostnamectl command. Hostname as you can see in the above screenshots is wildbeast, which is written on the command prompt. It is also your computer's name. Here it is asked to change the hostname to instance-UCID. Considering UCID is 1234(change it as required), the command to change the hostname is - sudo hostnamectl set-hostname instance-1234
9. To create system level cron jobs edit the /etc/crontab file and store your corn tasks there.
Cron syntax can be seen by opening the /etc/crontab file. To execute whoami command as given in the instructions, the corn syntax is-
56 5 15,28 9,10 * root /usr/bin/whoami
Explanation - 56(minutes), 5(hours), 15,28(dates of month), 9,10(month-September and October), *(day of week,here any day is fine so *), root(which user should run this command), /usr/bin/whoami (Command location)
10. To run the date cron job as specified, use the following syntax-
30 12 1-15 * 6 root /usr/bin/date
Explanation - 30(mins), 12(hours), 1-15(command should only run between 1-15 of the month), *(any month), 6(Saturday), root(user name which runs the command), /usr/bin/date (location of command).
You can edit the crontab file to write these commands by - sudo nano /etc/crontab and writing these 2 lines at the end of the file
OUTPUTS-
1. The output of getent passwd ava charlie automation.
2. The output of getent group marketing
sales.
3. The output of hostnamectl. (Hiding my
personal info with red blur here)
4. The output of cat /etc/crontab.
Get Answers For Free
Most questions answered within 1 hours.