0% found this document useful (0 votes)
150 views

Linux Notes

This document provides instructions for performing various system administration tasks on a Linux system such as installing packages, modifying user accounts and groups, configuring network interfaces, managing file systems and storage, and scheduling tasks. It includes commands to add and remove users, change user details and group memberships, install and uninstall packages, configure IP addresses and DNS, manage disk partitions and logical volumes, set file permissions and ownership, backup and restore files, and view and modify the system cron jobs.

Uploaded by

Reuben Cooper
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views

Linux Notes

This document provides instructions for performing various system administration tasks on a Linux system such as installing packages, modifying user accounts and groups, configuring network interfaces, managing file systems and storage, and scheduling tasks. It includes commands to add and remove users, change user details and group memberships, install and uninstall packages, configure IP addresses and DNS, manage disk partitions and logical volumes, set file permissions and ownership, backup and restore files, and view and modify the system cron jobs.

Uploaded by

Reuben Cooper
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

/root

en_US.UTF-8
/bin/bash
linuxls -l

12586
Mar 15 2009

su -
mv /home/placy/confid_wh /home/bcassini

shutdown -h +15 It is time for a shutdown!

At the prompt, type su - and press Enter.


Type 1worm4b8 as the password and press Enter.
Type rpm -ivh /home/wadams/Downloads/fontconfig-3.10.87-5.fc24.rpm and press Enter.
Type rpm -q fontconfig and press Enter to verify that the package is installed.

At the prompt, type rpm -e ddd-C-Debug and press Enter to uninstall the package.
Type rpm -q ddd-C-Debug and press Enter to verify that the package is installed.

At the prompt, type rpm -Uv kernel-tools-10.21.2015-54.fc21.rpm.


Press Enter to update the kernel-tools-10.21.2015-54.fc21.rpm package.

dnf install pulseaudio-equalizer.noarch

Procedure 1

At the prompt, type su - and press Enter to change to the root user.
Type 1worm4b8 as the root password and press Enter.
Type usermod -l bcassini bcasini and press Enter to change the account name.
Type usermod -d /home/bcassini bcassini and press Enter to change bcassini's home
directory.
Use cat /etc/passwd and press Enter to verify the changes.
Procedure 2

At the prompt in the wadams account, type su -c "usermod -l bcassini -d


/home/bcassini bcasini" and press Enter to complete this task using a single
command.
Type 1worm4b8 as the root password and press Enter.

509
Robert Cronn
50
/root

At the prompt, type usermod -c "Brenda Palmer" -d /home/bpalmer -m -l bpalmer


bcassini and press Enter.
Type cat /etc/passwd and press Enter.
Type ls /home and press Enter to verify that the account was modified.

At the prompt, type userdel -r thaslam and press Enter to remove the user account
and the home directory.
Type cat /etc/passwd and press Enter.
Type ls /home and press Enter to verify that the account was removed.

At the prompt, type su -c "passwd schawla" and press Enter.


Type 1worm4b8 and press Enter for the root user password.
Type G20oly04 and press Enter for the new password for the schawla user account.
Type G20oly04 as the new password and press Enter.

At the prompt, type groupmod -n western_sales_division sales and press Enter to


rename the sales group to western_sales_division.
Type groupadd eastern_sales_division and press Enter to create the
eastern_sales_division group.
Type usermod -G eastern_sales_division aespinoza and press Enter to modify group
membership. When you assign aespinoza to the eastern_sales_division group with the
usermod -G option, the user account is removed from the western_sales_division
group.
Use cat /etc/group or groups aespinoza to verify the aespinoza's group membership.

At the prompt, type groups schawla and press Enter to view a list of all groups the
user belongs to. You will see that schawla currently belongs to the mgmt1 and sales
group. The schawla group is the user's primary group.
Type usermod -aG mgmt2,hr schawla and press Enter to add hr and mgmt2 to the
secondary group memberships for the schawla user account.
Type cat /etc/group or groups schawla and press Enter to verify the changes.

Complete this lab as follows:

At the prompt, type one of the following commands and press Enter to view
information about the network interfaces to determine which card is not up and to
identify the card alias. (The alias for the network interface that is down is
enp2s1.)
ip addr
ip addr show
ip addr show enp2s1
ifconfig -a
Type one of the following commands and press Enter to start the enp2s1 network
interface:
ifup enp2s1
ip link set enp2s1 up

At the prompt, type ip addr show (or ifconfig) and press Enter to view the current
status of the network adapters.
Type cd /etc/sysconfig/network-scripts/ and press Enter.
Type ls and press Enter to view the files in this folder. Take note of ifcfg-enp2s0
and ifcfg-enp2s1 which are the configuration files for the network adapters.
Configure the settings for enp2s0 as follows:
Type nano ifcfg-enp2s0 and press Enter to edit the first adapter.
On the IPADDR line, type 192.168.0.254.
On the NETMASK line, type 255.255.255.0.
On the BROADCAST line, type 192.168.0.255.
On the GATEWAY line, type 192.168.0.5.
Type Ctrl + O.
Press Enter to save the file.
Type Ctrl + X to exit the editor.
Type ip link set enp2s0 down (or ifdown) and press Enter to bring the interface
down.
Type ip link set enp2s0 up (or ifup) and press Enter to bring the interface back up
with the new configuration.
Configure the settings for enp2s1 as follows:
Type nano ifcfg-enp2s1 and press Enter to edit the first adapter.
On the IPADDR line, type 10.0.255.254.
On the NETMASK line, type 255.255.0.0.
On the BROADCAST line, type 10.0.255.255.
On the GATEWAY line, type 0.0.0.0.
Type Ctrl + O.
Press Enter to save the file.
Type Ctrl + X to exit the editor.
Type ip link set enp2s1 down (or ifdown) and press Enter to bring the interface
down.
Type ip link set enp2s1 up (or ifup) and press Enter to bring the interface back up
with the new configuration.
Configure DNS as follows:
Type nano /etc/resolv.conf and press Enter to configure the DNS server addresses.
Type nameserver 163.128.78.93 and press Enter to start a new line.
Type nameserver 163.128.80.93.
Type Ctrl + O.
Press Enter to save the file.
Type Ctrl + X to exit the editor.
Type ping -c 4 192.168.0.5 and press Enter to confirm the connection to the
network.

1st
5th
62191
473632
1st
1st

2.9G
1.1G
52%

100 K
./.config
40 K

18432
20480
500
550

root
10240
9216
20480
wadams

ls /dev/sd*
pvcreate /dev/sdb1 /dev/sdc1
vgcreate data /dev/sdb1 /dev/sdc1
vgs
lvcreate --size 1t -n art data
mkdir product
mkfs.ext4 /dev/data/art
mount -t ext4 /dev/data/art product
cd product
touch newproduct
ls
df -h

mke2fs -j /dev/sdb1 and press Enter (the -j switch enables journaling).


mkfs -t ext3 /dev/sdb1 and press Enter.
mkfs.ext3 /dev/sdb1 and press Enter.
mke2fs -t ext4 /dev/sdc1
mkfs -t ext4 /dev/sdc1
mkfs.ext4 /dev/sdc1

mke2fs -t ext4 /dev/sdc2


mkfs -t ext4 /dev/sdc2
mkfs.ext4 /dev/sdc2

mkswap /dev/sdb2
swapon /dev/sdb2

mkdir /mnt/disk
mount -t ext3 /dev/sdb1 /mnt/disk
mount

umount /root/newdrive
mount /dev/sdb2 /mnt/drive2

quotaon /

edquota -u schan
1
soft
delete 9216
1048576
hard
delete 10240
1048576
ctrl _ x
Y
enter
repquota -a

edquota -u -t
1
block grace
delete 7
30
inode grace
delete 7
30
ctrl + x
Y
Enter
repquota -a

bcassini
proj
bcassini
wadams

chown bcassini /hr/payroll


ls -l /hr

chgrp mgmt1 /hr/personnel


chown .mgmt1 /hr/personnel
chown :mgmt1 /hr/personnel
chown -R bcassini:hr /hr
chgrp mgmt1 /hr/personnel

chmod 755 /hr

chmod g+w /hr/*

chmod 660 /hr/*

chmod o+rx /sales


chmod o+r /sales/*

umask 007

chmod u+s /usr/bin/xmms


chmod 4755 /usr/bin/xmms

chmod u-s /usr/bin/gpasswd


chmod u-s /usr/bin/newgrp
chmod g-s /usr/bin/wall
chmod g-s /usr/bin/write

tar -zcf /salesbkp.tar.gz /sales

tar -xzf /proj_files.tar.gz -C /projects

1993.392
1010712
2.6.33.3-85

lsmod
modprobe powermate
lsmod

rmmod gameport

1194
running
2.3
python

crontab -l
crontab -e
1
Press Enter.
Press Enter to create a new line in the editor.
On the new line, type 30 2 * * 2,6 /bin/updatedb.
Press Ctrl + O to write out (save) your changes.
Press Enter to accept the file name.
Press Ctrl + X to exit the editor.
Type crontab -l and press Enter to view the current crontab file.

dnf install cups


Y
lpr /home/wadams/sales

journalctl -k
q
journalctl -r
2019 01 10
10:14

ss -lt
netstat
enter
nano /etc/apache2/ports.conf
enter
81
8081
Ctrl+O
Enter
Ctrl+X
systemctl restart apache2
enter
ss -lt
enter
netstat
enter

192.168.0.5
198.28.56.1
65.86.24.136
65.86.1.1
163.128.80.93

6
192.168.0.5
73.44.216.14

In the Support Office, begin troubleshooting the problem by verifying the scope of
the connectivity problem as follows:
Under Support Office, select Support.
At the prompt, type ping 192.168.0.5 and press Enter to ping the gateway.
Press Ctrl + C. The ping fails.
Type ping 192.168.0.30 and press Enter to ping the computer in Office 1.
Press Ctrl + C. The ping fails.
Type ifconfig and press Enter to examine the network configuration. The IP
configuration for the network interface is on a different network.
Correct the problem on Support by configuring the network properties for the
interface as follows:
Type nano /etc/sysconfig/network-scripts/ifcfg-enp2s1 and press Enter to edit
the /etc/sysconfig/network-scripts/ifcfg-enp2s1 file to configure the interface.
On the IPADDR line, type 192.168.0.32.
On the BROADCAST line, type 192.168.0.255.
Press Ctrl + O.
Press Enter to save the file.
Press Ctrl + X to exit the editor.
Type ip link set enp2s1 down or ifdown enp2s1 and press Enter to bring the
interface down.
Type ip link set enp2s1 up or ifup enp2s1 and press Enter to bring the interface
back up with the new configuration.
Type ip addr show or ifconfig and press Enter to verify the correct IP address on
the interface.
Type ping 192.168.0.5 and press Enter to verify connectivity to the gateway.
Press Ctrl + C. The ping now succeeds.

On Office2, begin troubleshooting the problem by verifying the scope of the


connectivity problem as follows:
From the top navigation tabs, select Floor 1 Overview.
Under Office 2, select Office2.
At the prompt, type ping 192.168.0.5 and press Enter to ping the gateway. The ping
succeeds.
Press Ctrl + C.
Type ping 192.168.0.30 and press Enter to ping the computer in Office 1. The ping
succeeds.
Press Ctrl + C.
Type ping 198.28.56.1 and press Enter to ping the internal router interface.
Press Ctrl + C. The ping fails. Since you have connectivity to the local network,
but not beyond the gateway, this indicates a possible problem with the configured
gateway address.
Type route and press Enter to examine the configured gateway. The gateway is
configured incorrectly for this network.
Correct the problem on Office2 by configuring the network properties for the
interface as follows:
Type nano /etc/sysconfig/network-scripts/ifcfg-enp2s0 and press Enter to edit
the /etc/sysconfig/network-scripts/ifcfg-enp2s0 file to configure the interface.
On the GATEWAY line, type 192.168.0.5.
Press Ctrl + O.
Press Enter to save the file.
Press Ctrl + X to exit the editor.
Type ip link set enp2s0 down or ifdown enp2s0 and press Enter to bring the
interface down.
Type ip link set enp2s0 up or ifup enp2s0 and press Enter to bring the interface
back up with the new configuration.
Type ping 198.28.56.1 and press Enter to verify connectivity to the internal router
interface. The ping now succeeds.
Press Ctrl + C.

On ITAdmin, begin troubleshooting the problem by verifying the scope of the


connectivity problem as follows:
From the top navigation tabs, select Floor 1 Overview.
Under IT Administration, select ITAdmin.
At the prompt, type ping 192.168.0.5 and press Enter to ping the gateway.
Press Ctrl + C. The ping fails.
Type ping 192.168.0.30 and press Enter to ping the computer in Office 1.
Press Ctrl + C. The ping fails.
Type ping 192.168.0.34 and press Enter to ping the computer in Executive Office.
The ping succeeds.
Press Ctrl + C.
Type ifconfig and press Enter to examine the configured subnet mask. The subnet
mask is configured incorrectly. Only this workstation and the Exec workstation are
on the same network.
Correct the problem on ITAdmin by configuring the network properties for the
interface as follows:
At the prompt, type nnanano /etc/sysconfig/network-scripts/ifcfg-enp2s0 and press
Enter to edit the /etc/sysconfig/network-scripts/ifcfg-enp2s0 file to configure the
interface.
On the NETMASK line, type 255.255.255.0.
Press Ctrl + O.
Press Enter to save the file.
Press Ctrl + X to exit the editor.
Type ip link set enp2s0 down or ifdown enp2s0 and press Enter to bring the
interface down.
Type ip link set enp2s0 up or ifup enp2s0 and press Enter to bring the interface
back up with the new configuration.
Type ping 192.168.0.5 and press Enter to verify connectivity to the gateway. The
ping now succeeds.

You might also like