Chapter 2
Chapter 2
Local User Profiles are stored on the computer’s hard disk and are
available only to the user who created them.
Roaming User Profiles are stored on a server and are available to
the user from any computer on the network.
Mandatory User Profiles are a special type of roaming user profile
that has been pre-configured by an administrator to specify settings
for users. Settings commonly defined in a mandatory profile
include (but aren’t limited to) icons that appear on the desktop,
desktop backgrounds, user preferences in Control Panel, printer
selections, and more. Configuration changes made during a user’s
session that are normally saved to a roaming user profile aren’t
saved when a mandatory user profile is assigned. Mandatory user
profiles are useful when standardization is important, such as on a
kiosk device or in educational settings. Only system administrators
can make changes to mandatory user profiles .
2
Page
A user who creates a file is also the owner and group owner of
that file. The file is assigned separate read, write, and execute
permissions for the owner, the group, and everyone else.
Shadow Passwords
default.
Page
The following is a list of the advantages shadow passwords have
over the traditional way of storing passwords on UNIX-based
systems
The useradd command with the -e, --expiredate or -f, --inactive option.
The default values for password aging controls can be found and
configured in the file cat /etc/login.defs.
the root user. So, if you are user Zewdu, you cannot make
Page
changes to files and folders owned by Abay without the help of
root (or sudo).
For example:
sudo – this is used to gain admin rights for the command on any
system that makes use of sudo (otherwise you’d have to ‘su’ to root
and run the above command without ‘sudo’)
9
Page
u – user
g – group
o – other
r – read
w – write
10
x – execute
Page
Using the -R switch is important. If you have a number of sub-
folders and files within the SHARE directory, and you want the
permissions to apply from the parent object (the containing
folder) to the child objects (the sub-folders and files), you must
use the -R (recursive) switch so the same permissions are
applied all the way to the deepest folder, contained within the
parent.
sudo – admin rights must be used since we are dealing with a folder that belongs to another user
ls -lha
r: Read
w: Write
x: eXecute
Note
u user o others
g group a all
Disregarding the first bit, each bit that is occupied with a - can
16
000 0 —
001 1 –x
010 2 -w-
011 3 -wx
100 4 r–
101 5 r-x
110 6 rw-
111 7 rwx
Each digit is independent of the other two. Therefore, 750 means
the current user can read, write, and execute, the group cannot
write, and others cannot read, write, or execute.
600 permissions means that only the owner of the file has full
read and write access to it. Once a file permission is set to 600,
no one else can access the file. Below are example chmod
commands in octal and symbolic notions that set permissions to
600:
664 (rw-rw-r--) enables read and write for the owner, read and
write for the group, and read for others. If you trust other users
within the same group and everyone needs write access to the
files, this is a common setting to use. Below are example chmod
commands in octal and symbolic notions that set permissions to 664:
18
chmod +x ~/example.py
The default permissions for files on a Unix system are often 600
or 644. Permissions of 600 give the owner full read and write
19
access to the file, but no other user can access it. Alternatively,
Page
644 grants the owner read and write access, while the group
members and other system users only have read access.
You can remove all access to these files with commands in one
21
Read (r): User can list the items in a directory, such as when
using the ls command.
ls -la
22
Page
The output should be similar to the snippet below:
total 12
example-directory
Directories are differentiated from files by the first bit within the
permissions. As covered previously,
ls -dl EXAMPLE_DIRECTORY
23
Page
1. Open Linux
2. Navigate to the target file or folder
3. Right click the file or folder
4. Select Properties
5. Click on the Permissions tab
6. Click on the Access files in the Others section
7. Select “Create and delete files”
8. Click Change Permissions for Enclosed Files
9. In the resulting window, Select Read and Write under Files
and Create and delete files under Folders (Figure A)
10. Click Change
11. Click Close.
25
Page
The trick comes when you need to change the permissions of a
folder which does not belong to you. It can be done, but Linux
must be started with admin access. To do this, follow these
steps:
After you’ve completed the task, close the Linux window and
then the terminal window.
The command takes two arguments: the new owner and the file
Page
or directory to be changed.
For example, to change the owner of a file named file.txt to a
user named newuser, you would use the following command:
sudo chown newuser file.txt.
4 for read,
2 for write,
1 for execute.
For example,
29
chmod 755 file.txt would give the owner read, write, and execute permissions,
Page
while the group and others would have only read and execute permissions.
To change the ownership of a file or directory, you can use the
chown command.
The command takes two arguments: the new owner and the file
or directory to be changed.
limits effectively control the total number of files a user may own.
Page
$ quota -u username
Remember that disk quotas ensure fair allocation of disk space among
users and prevent unexpected storage shortages. They are a powerful
tool for maintaining system stability and resource management