






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Figure 1 Controller IDE
Step 1: Insert the “TinyNetConfig iso” file into the controller IDE, then power on the virtual machine. Step 2: To install the random fortune, which is in the game package, go to mc mnt/hdc/SetupMenu and click enter. Next, choose Install Other Packages. Figure 2 tinynet repository Figure 3 installed successful Figure 4 install games
Step 5: Go to /etc/profile.d and create a file by using hotkey command- shift+F4 and name the file as anything.sh Step 6: After creating the file, click F4 to edit the file. Insert this command “echo -e "
e[01;32m"; fortune |boxes -d columns -a hcvc; echo -e "\e[00m" and then save it. This command will allow the VM to display random fortune in green colour from the folder of /usr/share/games/fortune/fortune whenever a user log in. Step 7: Lastly, to change permission of the file anything.sh, click F9 and go to File > CHmod. Then, choose execute/search by owner, execute/search by group, execute/search by others and click Set. Figure 8 Chmod command Figure 7 insert code
Outcome The command summary that will appear in login screen has been removed. The green random fortune will appear after the user login. Figure 9 blank command summary Figure 10 TP login
Step 2: Go to /etc/sudoers and click F4 to edit the file.Under the defaults specifications, add the line Defaults edit=/usr/bin/mcedit:/usr/bin/vi Step 3: Under the user privilege specification, uncomment the %wheel lines. This is to enable the group wheel to run all the commands as we have added tp046306 into the wheel group. Step 4: To disabled root access, type in the command passwd -l root (-l means lock). The system will displayed Password changed which means the root has successfully bring lock. Step 5: To prevent root login via SSH, go to /etc/ssh/sshd_config and under the authentication section, change the PermitRootLogin from yes to no. Figure 13 sudoer Figure 14 disabled root access Figure 15 sshd config
Outcome User unable to use su to switch from user to root. The root account is locked so the user is not allowed to login to root. To prove that the sudo command is functional on the user account tp046306. User needs to type sudo -i to access the root account. Figure 16 root disabled Figure 17 unable to log in as root Figure 18 sudo -i Figure 19 sudo 1s -1a /root
Fortune The obstacle that I have encountered is I couldn’t display anything after the user has log in. The reason is I did not download the games package which I should have because the random fortune is from the game package. Besides, after researching, I then learn that I have to echo the fortune from the package by creating a .sh file and make it executable by users, groups and others. Sudo One of the obstacles that I have encountered in sudo is that I could not run sudo commands in normal user account. Hence, I realise that I have not set the normal user in the wheel group. So, I delete the user and re-create the user but this time I set the user in the wheel group and finally the normal user can then run sudo commands.