0% found this document useful (0 votes)
71 views3 pages

CIS1300 Assignment9 Aydin, Noyan

This memo discusses operating system assignments. It provides instructions on: 1) Enabling and disabling the root administrator user on a Linux system using sudo passwd commands. 2) Explaining the purpose and output of id, w, who, and cat /etc/shadow commands. 3) Troubleshooting the creation of a new user account named "donnie" using useradd, including creating the home directory with the correct ownership and assigning a password.

Uploaded by

ijohndeo00
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)
71 views3 pages

CIS1300 Assignment9 Aydin, Noyan

This memo discusses operating system assignments. It provides instructions on: 1) Enabling and disabling the root administrator user on a Linux system using sudo passwd commands. 2) Explaining the purpose and output of id, w, who, and cat /etc/shadow commands. 3) Troubleshooting the creation of a new user account named "donnie" using useradd, including creating the home directory with the correct ownership and assigning a password.

Uploaded by

ijohndeo00
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

HC CIS1300

Memo
To: Mike MacDonald

From: Noyan Aydin

Date: November 19, 2023

Re: CIS 1300 Operating Systems Assignment 9

Section 1. Questions

1. Yes, modern operating systems disables root administrator or alike users. For whatever
invalid reason an administrator wants to enable it, here is the way;
a. If you are enabling the root user for the first time, you need to assign a password;

sudo passwd root


That would give a password to root and enable the user to login.
b. The root is not to be left enable any more minutes than absolutely necessary. To
disable it, we use the same command to lock out any user;
sudo passwd -l root

On screenshot, I tried to su root before enabling, failed. Then, after giving a


password, I could su root. After locking it out, root was again not available to
login.
2. id is used without parameters defines the user who run the command, that is you learn
your id and your groups. It also supplies the group ids of your memberships. w alone is a
delight for system admin because it gives all logged in user list and what they are up to.
who is the light version of w, skipping some details like running apps.
a. id without parameters is the command for learning lots about your user. It not
only gives your user id, but also your groups and their ids too.
id
command gives
uid=1000 (noyana) ….
This user is your own user, but if you need to make sure, run whoami command
to match it. This means my uid is 1000, the first created user.
b. The same command id gives the same level of information for the user name
you supplied in parameter.
id root
command gives
uid=0 (root) …
This means root’s uid is 0.
c. However the id gives the list of your groups with the group ids, groups
command gives the group names in a shorter and clear format. You need to type
it without parameters for the information of yourself only.
groups
gives
noyana adm cdrom sudo dip plugdev lxd
This is the list of my groups.
d. The passwords are stored in /etc/shadow file. The file is not allowed for everyone
to take a peek. You need to run ”sudo cat /etc/shadow”. The file has password
information in it, but in hashed form. The first character has special meaning to
indicate the status information like lock out. The length of the hash has nothing to
do with the password length of your choice.

3. I looked up to the help of useradd command and see the home directory command
option is -d. My first instinct was useradd -d /home/donnie donnie. After trying to
login with username donnie and failing, a further investigation revealed that the home
directory was not created but just written in the /etc/passwd file only. Creating home
directory proved tricky, I created the directory with sudo command to create a directory

2
under /home, but then the directory owner was root, not the user donnie. This is why I
needed to chown command to give the ownership to donnie. That didn’t help to have
donnie to appear on the list of user to login, though. What is required donnie to have
listed is giving a password, a full or empty one, by using sudo passwd donnie or sudo
passwd -d donnie. Assigning a password added donnie to the list of users.
a. sudo useradd -d /home/donnie donnie
b. sudo passwd -d donnie
c. sudo adduser mikey
d. Those commands, adduser and useradd, are very different. useradd is so basic
that the administrators should either use them very carefully or just for scripts, in
my personal opinion. adduser is a script to make sure the user has proper home
directory, shell, and a strong password. Other differences can be considered
cosmetic.

Common questions

Powered by AI

First, verify if the home directory was actually created and if its ownership is correctly assigned using 'chown'. Next, check if a password is set or required by using `sudo passwd [username]`, and ensure that essential details like a login shell are configured. Additionally, confirm that the user is listed in necessary files like '/etc/passwd', which often account for initial login issues .

The 'passwd' command is central to managing user credentials, allowing administrators to set or change user passwords, which are stored in a secure hashed form in '/etc/shadow'. This command supports enabling or disabling accounts and ensures expelled accounts are locked from access, maintaining system security. By assigning passwords, it helps list new users for login, as demonstrated by needing a password set for login viability after account creation .

Restricting the duration a root user remains enabled is critical because prolonged enablement increases the risk of unauthorized access and potential exploitation of root privileges. Retaining root access only when necessary minimizes opportunities for vulnerabilities to be exploited, thus protecting sensitive system operations and configurations from inadvertent or malicious alterations .

The 'id' command reveals a user's user ID and the IDs of groups they belong to, providing detailed identity verification. Meanwhile, the 'groups' command lists the names of all groups to which the user belongs, offering a simpler view focused on group membership. Together, these commands offer both comprehensive and simplified perspectives on user identity and permissions within the system .

File permissions are crucial to protecting data integrity and user privacy, especially for critical files like '/etc/passwd' and '/etc/shadow'. '/etc/passwd' is world-readable for general user information without sensitive data, while '/etc/shadow' is restricted to prevent unauthorized access to hashed passwords. These permission settings balance accessibility for system functions with security to safeguard credential information .

The '/etc/shadow' file is restricted from universal access due to its sensitive nature; it contains hashed passwords for system users. Allowing unrestricted access could pose significant security threats, as attackers could gain insights into password structures, despite their hashed form. The file employs specific symbols to indicate password state, such as locked accounts, emphasizing the need for tightly controlled access .

Manually creating a home directory can lead to ownership issues, as the directory may default to being owned by root. This complicates user access unless corrected with 'chown'. Additionally, manual omissions in configuring the user's shell or permissions can prevent login. These challenges are mitigated by using comprehensive tools like 'adduser', which automatically ensures that home directories and permissions are correctly set up and aligned with user needs .

Modern operating systems typically disable the root user by default for security reasons. To enable the root user, an administrator must first assign a password using the command `sudo passwd root`, which allows the root to login. It's vital not to leave the root enabled longer than necessary to reduce security risks, which can be done by locking the user with `sudo passwd -l root`. This approach ensures the root privileges are available only when strictly necessary, minimizing potential unauthorized access .

The 'id' command without parameters provides comprehensive information about the user's user ID, group IDs, and associated groups. In contrast, 'whoami' simply returns the active user’s name, while 'groups' gives the names of groups the user is a member of. Therefore, 'id' offers a broader scope of information by integrating the user's identity and group affiliations compared to the more specialized output of 'whoami' and 'groups' .

Using 'useradd' often requires additional steps, as it does not automatically set up a home directory, shell, or password, which can lead to errors such as login failures. For instance, a directory specified during user creation might not be automatically created or appropriately owned by the new user, necessitating manual interventions such as 'mkdir' and 'chown'. In contrast, 'adduser' handles setups and configurations more comprehensively, minimizing the need for manual corrections and is preferable for routine user account creation .

You might also like