June 2, 2024
The useradd command is used to create new users in Linux systems.
To provision the proper sudo requirements for Gary Thatcher’s user, use the command visudo to edit the /etc/sudoers file.
sudo visudo Sudo permissions can be assigned at the bottom of file, to allow Gary Thatcher’s profile to use sudo with all commands, the following line is appended to the sudoers file.
gthatcher ALL=(ALL) ALL
To allow Rob to run sudo without a password, an entry is created in the sudoers file and the NOPASSWD field is added at the end.
In this case, Rob is authorized to use sudoedit on all files within /var/www/html/, and is authorized to use systemctl to manage the httpd service.
To accomplish this, the authorized commands added to rob’s entry in the sudoers file. The final entry appears as follows:
The Prod-Web host’s Linux distribution is CentOS which uses the Yum package manager. The following command is used to update packages in yum:
New copies of the repository files were required to allow yum to download updates.
First, a copy of the existing repository directory was created with the following command:
sudo cp yum.repos.d yum.repos.d.BAK After which, a new yum.repos.d directory was created.
sudo mkdir yum.repos.d Within this folder, valid repo files were downloaded from https://raw.githubusercontent.com/cloudrouter/centos-repo/master/CentOS-Base.repo
sudo curl https://raw.githubusercontent.com/cloudrouter/centos-repo/master/CentOS-Base.repo-o ./CentOS-Base.repo This was done for each of the .repo files in the github repository.
After downloading the files, yum can be run successfully to update the Apache service.
To generate SSH keys, Linux’s ssh-keygen utility is used.
After the utility completes, the public key must be copied to the Dev-Web server. To accomplish this, the Linux utility ssh-copy-id is used.
The Dev-Web server’s IP address can be located in the network map.
Previous post
Next post