Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Linux terminal Write a bash command line for the following actions 1.- Create a

ID: 3601866 • Letter: L

Question

Linux terminal

Write a bash command line for the following actions 1.- Create a regular user named user01. 2.- As super-user create a directory called backup under the home directory of user01 and change the owner and group associated to the directory to user01 3.- Set security on the backup directory so that user01 has all permissions and no one else has any permissions. 4.- Write a script for creating a backup of all your data in the folder backup. In the creation of the copy of security exclude the copy of the folder backup. The name of the backup must be like backupUserData 10 26_17.zip. The name of the script and location will be /home/user01/backup/backupUserData.sh 5.- Add the script above to the crontab scheduler of user01 in such a way that a new copy of security is created every Friday at 11:30 pm. Specify the text line to be added in the job scheduler.

Explanation / Answer

The following command will add a new user called test to your system:

sudo useradd test

What will happen when this command is run will depend on the contents of the configuration file located in /etc/default/useradd.

To view the contents of /etc/default/useradd run the following command:

sudo nano /etc/default/useradd

The configuration file will set a default shell which in Ubuntu is bin/sh. All the other options are commented out.

The commented out options allow you to set a default home folder, a group, number of days after the password has expired before the account becomes disabled and a default expiry date.

The important thing to glean from the above information is that running the useradd command without any switches may produce different results on different distributions and it is all to do with the settings in the /etc/default/useradd file.

In addition to the /etc/default/useradd file, there is also a file called /etc/login.defswhich will be discussed later in the guide.

Important: sudo is not installed on every distribution. If it is not installed you need to log into an account with appropriate permissions for creating users

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote