The purpose of this assignment is to learn (or review) some of the standard
system administration functions on a Linux system, including account
administration, process control, and periodic processes. Use the script
command to capture the output of all commands in R2.log
, for submission at
the end of the recitation.
sudo
and su
worksudo
and su
don’t really “change” your current user id.
They run another instance of bash
, called a sub-shell,
with the permissions that you asked for. To stop having those
permissions, type “exit” to terminate the shell, and you’ll go
back to your previous shell with the previous permissions.
Use the id
command to find out what user you are, at any time.
sudo -s
groupadd
to define presidents, governors, mayors, and senators groups.
groupmod
to change the GID for senators.
groupmod
to restore the GID for senators.
groupdel
to delete the senators group.
/etc/group
for group names and GIDs.
useradd
to add users with the following attributes:
User Name | Home Directory | Password | Shell | Primary Group | Secondary Group |
---|---|---|---|---|---|
taft | /home/taft | william | /bin/bash | users | presidents |
wilson | /home/wilson | woodrow | /bin/bash | users | presidents |
lincoln | /home/lincoln | abe | /bin/bash | users | presidents |
adams | /home/adams | john | /bin/sh | users | presidents |
grant | /home/grant | ulysses | /bin/sh | users | presidents |
/bin/bash
.
usermod
to change the shell to /bin/sh
for lincoln.
/bin/sh
.
sudo
and passwd to change the password for grant.
su grant
to login to the grant account.
userdel
to delete all the accounts that you added.
ps
with the -e
, -f
options.
ps
only—no grep
or other filtering commands.
top
.
top
with half-second between screen updates.
top
only with your processes.
ps
and the -C
option.
gedit
isn’t installed, then install it.
gedit
session using the kill command with the SIGKILL signal.
crontab
:
-e
to edit, -l
to list, -r
to remove.
-print
from your home directory into R2.cron
.
grep -i cron /var/log/syslog
R2.script
that executes ls -l
in your home directory.
R2.cron
in your home directory.
R2.cron
.
R2.script
and R2.cron
into R2.log
.
script
command with control-D.
R2.*
.