task 1&2 scripts
Posted: Tue Dec 16, 2008 1:10 pm
TASK I
groupadd -g 600 dogs
useradd -g dogs -u 601 -c "one ofn three dogs" -d home/dog-one -s /bin/bash dog-one
passwd dog-one # Do Passwd Dialogue for each of three. (dog1, dog2, dog3)
passwd -d dog-one
usermod -L dog-two
chage -d 0 dog-two
usermod -U dog-two
user mod -L dog-three
vi /home/dog-one/.bash_profile
> alias woof=who
ctrl,wq;
echo "All Dogs Welcome Here." > /etc/motd
tail /etc/group >> task1
tail /etc/motd >>task1
tail /etc/shadow >> task1 #..(!dog-three)
tail /home/dog-one/.bash_profile >> task1
tail /etc/group >> task1
cat task1 >> final
TASK II:
# Turn off machine. Add a 5g hard disk. Turn machine on.
fdisk /dev/sdb # (n, p, +200M, w)
mke2fs -t ext3 /dev/sdb1
mount /dev/sdb1 /mnt
cd /home
cp -R * /mnt
mkdir /saves
mv -Rf * /saves
e2label /dev/sdb1 /home
vi /etc/fstab
# append "LABEL=/home /home ext3 usrquota,defaults 1 2 " to /etc/fstab/
mount -0 usrquota /dev/sdb1 /home
quotacheck -cuv /dev/sdb1
edquota dog-one # edit the "hard" and "soft" collumns (4500,5000)
OR "setquota -u dog-one 4500 5000 0 0 -a /dev/sdb1" ####lesson 9 slide 97
repquota -a
edquota -p dog-one `awk -F: '$3 > 499 (print $1)' /etc/passwd`
cd /home/dog-one
su dog-one ##test quotas
dd if=/dev/zero of=filler bs=1024 count=200
> big; for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do du; cat filler >> big; done
groupadd -g 600 dogs
useradd -g dogs -u 601 -c "one ofn three dogs" -d home/dog-one -s /bin/bash dog-one
passwd dog-one # Do Passwd Dialogue for each of three. (dog1, dog2, dog3)
passwd -d dog-one
usermod -L dog-two
chage -d 0 dog-two
usermod -U dog-two
user mod -L dog-three
vi /home/dog-one/.bash_profile
> alias woof=who
ctrl,wq;
echo "All Dogs Welcome Here." > /etc/motd
tail /etc/group >> task1
tail /etc/motd >>task1
tail /etc/shadow >> task1 #..(!dog-three)
tail /home/dog-one/.bash_profile >> task1
tail /etc/group >> task1
cat task1 >> final
TASK II:
# Turn off machine. Add a 5g hard disk. Turn machine on.
fdisk /dev/sdb # (n, p, +200M, w)
mke2fs -t ext3 /dev/sdb1
mount /dev/sdb1 /mnt
cd /home
cp -R * /mnt
mkdir /saves
mv -Rf * /saves
e2label /dev/sdb1 /home
vi /etc/fstab
# append "LABEL=/home /home ext3 usrquota,defaults 1 2 " to /etc/fstab/
mount -0 usrquota /dev/sdb1 /home
quotacheck -cuv /dev/sdb1
edquota dog-one # edit the "hard" and "soft" collumns (4500,5000)
OR "setquota -u dog-one 4500 5000 0 0 -a /dev/sdb1" ####lesson 9 slide 97
repquota -a
edquota -p dog-one `awk -F: '$3 > 499 (print $1)' /etc/passwd`
cd /home/dog-one
su dog-one ##test quotas
dd if=/dev/zero of=filler bs=1024 count=200
> big; for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do du; cat filler >> big; done