SpiderTools.com
Linux Training Experts
home | Order
Page | reseller program |
specials | contact
copyright CyberMontana Inc.


|
Linux
Training Courses in Missoula, MT
|
|
Basic
Linux Training Package:
Date:
Oct.
22-23
Cost: $195.00
This
course is designed to help new Linux users establish a foundation
in Linux so that they can advance quickly in the Linux experience.
|
Fall
Linux Classes
Basic Linux ($195.00) Oct
22-23
Linux Commands(
($110.00) - Oct. 29
Basic Administration
($110.00)- Oct. 30
Gimp Image Editing
($69.99) -
Nov. 5,6,12,13
Gimp Image Editing
II ($49.99) Nov.19,20
Linux Security ($110.00)
-Dec. 3
Package Deal
Regular Price $644.98
Get all 6 Classes Only $499.00
Order
|
Learn
the Power of Linux Commands
Examples
Project:
Delete User and Manage Files
In every organization, people leave to move onto new locations.
When they leave their accounts need to be managed as well as the
files that they have created need to be moved to the user who
will take their place.
Commands
that will be used in this project:
rm, touch, chmod, useradd, ls, userdel
Project must be done as root (practice on a test machine).
Step 1: Add New Users
There are several things to keep in mind when adding a new user.
Possibly the most important is whether the Linux operating system
you are using automatically creates private groups for each user
or not. Red Hat for example creates a user and group with the
same name when the user is created. This means that no other user
on the system, except root, may view the contents of another user.
This is called a private group. SuSE on the other hand will create
a user and then place all users in the users group. This is a
significant difference because all users by default may view the
contents of all other users home directories by default. As an
administrator do not make the mistake of thinking files are confidential
when all users actually can view them!
Create a User for Practice in Deleting
useradd tom
This will create a /home/tom directory. This directory will be
set up automatically for rights so that tom may use the directory
and programs. Now create file in the directory as root so that
thee file will represent the files that you will move to another
user's directory.
touch
personal1.rtf personal2.rtf doc1.pdf doc2.pdf /home/tom
This command creates multiple files at the same time. These are
empty files but will serve as an example in the project.
Change
the rights so that tom owns all files. Both the user and group
will be changed to tom so that it will illustrate the private
group setting.
chown
tom:tom /home/tom/*.rtf
chown tom:tom /home/tom/*.pdf
Now all files are owned by tom that are in the /home/tom directory.
The
next step is to create the user who will replace tom.
useradd mary
Now at the least you should have a /home directory with mary and
tom. When a user leaves their account should be deleted for security
reasons, their personal files should be deleted but company files
need to be transferred to the user who replaces them.
Step
2: Transfer Files to the New User
These files will be treated as if they are company files that
need to have rights transferred to the next user.
cp /home/tom/*.pdf /home/mary
Notice the cp command is used instead of the move command, mv.
If these are important company files you may want to verify that
the files are actually in place before they are deleted. If you
made a terrible mistake in the mv command the files could be destroyed,
though the mv command is usually a safe command.
chown mary:mary /home/mary/*.pdf
This command now changes the rights to the correct user. You can
verify the rights by using this command:
ls -la /home/mary/*.pdf
Step
3: Delete the Old User and Files
Often when you use the userdel command the user is deleted and
you will be asked if you want to delete the user's home directory
as well. If you say yes you are then finished.
userdel
tom
|