---
# System prepended metadata

title: Linux_Basic-Шихтаимов_Шихтаим-Практика-2

---

Linux_Basic-Шихтаимов_Шихтаим-Практика-2
===

### Часть 2.1

df 

![](https://i.imgur.com/8uNHJMH.png)

df -BM

![](https://i.imgur.com/1AADvIk.png)

df -H

![](https://i.imgur.com/aixbPsa.png)

df -i

![](https://i.imgur.com/xbIAcHT.png)

df -k

![](https://i.imgur.com/hKBZe7E.png)

df -P

![](https://i.imgur.com/GCP4Fh7.png)

df -h

![](https://i.imgur.com/j0LtATg.png)

df -a

![](https://i.imgur.com/50kX0EQ.png)

df -x tmpfs

![](https://i.imgur.com/U8vE8Ht.png)

df -x devtmpfs -x tmpfs

![](https://i.imgur.com/G0VFvdF.png)

df -t ext4

![](https://i.imgur.com/laoGY6N.png)

df -h /dev/sda1

![](https://i.imgur.com/m1LKtSo.png)

df -hi /dev/sda1

![](https://i.imgur.com/9qhm854.png)

df -h /home

![](https://i.imgur.com/oTL5gpv.png)

du /etc

![](https://i.imgur.com/4l4lWx9.png)

du /etc /home /tmp

![](https://i.imgur.com/vkN5kpF.png)

du -a /etc

![](https://i.imgur.com/Ddig3IU.png)

du -h /var

![](https://i.imgur.com/ME7SumM.png)

du -sh /var

![](https://i.imgur.com/nubcusB.png)

du -csh /var/log /var/lib

![](https://i.imgur.com/Y6eix1o.png)

du -h --max-depth=1 /var/lib

![](https://i.imgur.com/MRevN4v.png)

du -sh --apparent-size /var/lib

![](https://i.imgur.com/mFheIuj.png)

du -csh /tmp/Do*

![](https://i.imgur.com/4h0Ba4w.png)

du -h /var/ | sort -rh | head -5

![](https://i.imgur.com/fI3sF2C.png)

free

![](https://i.imgur.com/r5ZPDEH.png)

free -w

![](https://i.imgur.com/qPpgwO5.png)

free -h

![](https://i.imgur.com/VTdHAvI.png)

free --mega

![](https://i.imgur.com/iobgmWi.png)

free -h -t

![](https://i.imgur.com/d5Bm5lE.png)

free -s 5

![](https://i.imgur.com/Ri5vdHd.png)

free -s 5 -c 10

![](https://i.imgur.com/473KdGD.png)

free -h --si -s 5 -c 4

![](https://i.imgur.com/1zuYnce.png)

watch free -h

![](https://i.imgur.com/geXI1YV.png)

iostat

![](https://i.imgur.com/nh5BHrO.png)

iostat -d

![](https://i.imgur.com/Gxv1QAN.png)

iostat -x

![](https://i.imgur.com/mYLf4p4.png)

iostat -c

![](https://i.imgur.com/zeohuMQ.png)

iostat -d 

![](https://i.imgur.com/EtPTyCr.png)

iostat -h

![](https://i.imgur.com/YoDSBFq.png)

iostat -k

![](https://i.imgur.com/XS6uy6Z.png)

iostat -m

![](https://i.imgur.com/qBc1M6m.png)

iostat -o JSON

![](https://i.imgur.com/Of9Hc4e.png)

iostat -p /dev/sda1 1

![](https://i.imgur.com/YIg1yKu.png)

iostat -x

![](https://i.imgur.com/oWm84xg.png)

iostat -y

![](https://i.imgur.com/ZUdIbx4.png)

iostat -z

![](https://i.imgur.com/3Duw0ko.png)

iostat /dev/sda1

![](https://i.imgur.com/m05v1yo.png)

iostat -p /dev/sda1

![](https://i.imgur.com/zQcEX2m.png)

iostat -y -p /dev/sda1 1

![](https://i.imgur.com/eVjU8IS.png)

df -hl

![](https://i.imgur.com/zVbBoIu.png)

iostat -xk -t 10 | awk '// {print strftime("%Y-%m-%d %H:%M:%S"),$0}' >> iostat.log &

![](https://i.imgur.com/jzo0wqL.png)

iostat -xk -t 10 | awk '// {print srtftime("%Y-%m-%d %H:%M:%S"),$0}'

![](https://i.imgur.com/XkRv1On.png)

cat iostat.log

![](https://i.imgur.com/lzWNNao.png)

mpstat -A

![](https://i.imgur.com/wjQFQ80.png)

mpstat -P ALL

![](https://i.imgur.com/PfXp8vf.png)

mpstat -P 0

![](https://i.imgur.com/8Unzcvg.png)

mpstat -V

![](https://i.imgur.com/1CROB9Y.png)

mpstat --help

![](https://i.imgur.com/mhB8qmx.png)

vmstat

![](https://i.imgur.com/5w5VWiO.png)

vmstat 3

![](https://i.imgur.com/hvHd51w.png)

vmstat -a

![](https://i.imgur.com/YsOCTJW.png)

vmstat -f

![](https://i.imgur.com/007X88U.png)

vmstat -d

![](https://i.imgur.com/pQWlEZa.png)

vmstat -D

![](https://i.imgur.com/KSiU5Pj.png)

vmstat --help

![](https://i.imgur.com/KmIphoY.png)

w

![](https://i.imgur.com/c2bcK48.png)

w -h

![](https://i.imgur.com/wTrctyZ.png)

w -u 

![](https://i.imgur.com/IBp5vKe.png)

w -s

![](https://i.imgur.com/vTfWWDE.png)

w -f

![](https://i.imgur.com/qB8USVI.png)

w -i

![](https://i.imgur.com/fzvsk0w.png)

w -o

![](https://i.imgur.com/0rOzbj0.png)

w -V

![](https://i.imgur.com/eMc7W0x.png)

htop

![](https://i.imgur.com/JtMvLOV.png)

htop -d 1

![](https://i.imgur.com/AHJP2Q3.png)

htop -t

![](https://i.imgur.com/50WpYI1.png)

### Часть 2.2

service ssh status

![](https://i.imgur.com/0AtaKgE.png)

Настроил /etc/ssh/sshd_config согласно заданию и прописал systemctl restart ssh для применения настроек

![](https://i.imgur.com/mBtKCRb.png)

Подключился с putty

![](https://i.imgur.com/IEylRsb.png)

![](https://i.imgur.com/JA8yXIt.png)

![](https://i.imgur.com/LZgdktA.png)

Создал alias

![](https://i.imgur.com/cr7Y9Bh.png)

Подключился по alias

![](https://i.imgur.com/aQFZJqb.png)

Сгенерировал rsa-ключи

![](https://i.imgur.com/XrZMTNu.png)

Пробросил ключи

![](https://i.imgur.com/H1YxsaY.png)

Отключил вход по паролю и вошел

![](https://i.imgur.com/GT0o0t0.png)

### Часть 2.3

Перезаписал ключи rsa 

![](https://i.imgur.com/PuIRqkL.png)

Пробросил ключи

![](https://i.imgur.com/aTBOnpT.png)

Вошел без пароля

![](https://i.imgur.com/NJVoxUA.png)

Отключил аутентификацию по паролю

![](https://i.imgur.com/PBRqTUQ.png)

Пробросил ключи без использования пароля

![](https://i.imgur.com/K8zd66p.png)

### Часть 2.4

cat /etc/*release

![](https://i.imgur.com/AbdSBUr.png)

uname -a

![](https://i.imgur.com/81AnVf0.png)

whoami

![](https://i.imgur.com/n0xZXln.png)

uptime

![](https://i.imgur.com/uKrYwsh.png)

ls -la /home

![](https://i.imgur.com/pd8ghtW.png)

chmod o-rx /home/kali

![](https://i.imgur.com/YBuVLrj.png)

ip neigh

![](https://i.imgur.com/HXS0plQ.png)

ss -tlnp

![](https://i.imgur.com/0J4LWEg.png)

sudo -l

![](https://i.imgur.com/4oQgHbW.png)

sudo find / -user root -perm -4000 -exec ls -ldb {} \\; 2> /dev/null

![](https://i.imgur.com/1E1J4Fh.png)

wget https://downloads.cisofy.com/lynis/lynis-3.0.6.tar.gz

![](https://i.imgur.com/8Nzv4sD.png)

tar -xvf lynis-3.0.6.tar.gz

![](https://i.imgur.com/QoY9ZRz.png)

sha256sum lynis-3.0.6.tar.gz

![](https://i.imgur.com/295VgVE.png)

cd lynis, ls

![](https://i.imgur.com/zthkamF.png)

sudo ./lynis audit system 

![](https://i.imgur.com/nKb1UIb.png)

![](https://i.imgur.com/K4MZ8c0.png)

report-отчет

![](https://i.imgur.com/VN3fK1N.png)

sudo ./lynis show options

![](https://i.imgur.com/rB1NQKh.png)

/var/log/lynis-report.dat

![](https://i.imgur.com/EmavwFu.png)

dpkg -l

![](https://i.imgur.com/vkPMrNY.png)

dpkg -L coreutils

![](https://i.imgur.com/rjapdO7.png)

/bin/dir --help

![](https://i.imgur.com/YoR5D9o.png)

sudo mv /bin/dir /bin/dir.bak

![](https://i.imgur.com/Dy6vTcu.png)

sudo cp /bin/false /bin/dir

![](https://i.imgur.com/zsniecb.png)

echo $?

![](https://i.imgur.com/XhIchE5.png)

debsums

![](https://i.imgur.com/qE0vVuF.png)

debsums -ac coreutils

![](https://i.imgur.com/Hw9D3mT.png)

debsums -cs coreutils

![](https://i.imgur.com/R4YCImP.png)

dpkg --verify coreutils

![](https://i.imgur.com/BohBm4F.png)

sudo find / -printf "%T@;%Tc;%p\\n"

![](https://i.imgur.com/emfJ3k3.png)

sudo find /home/kali/ -printf "%T@;%Tc;%p\\n" > timeline.csv

head timeline.csv

![](https://i.imgur.com/d6PcdVG.png)

sort -rn timeline.csv | less

![](https://i.imgur.com/eXteb0Y.png)

### Часть 2.5

apt-get install coreutils

![](https://i.imgur.com/YALFNsj.png)

printenv

![](https://i.imgur.com/E8b5Hu7.png)

TESTKALI=/home/kali

![](https://i.imgur.com/UNudkPo.png)

echo $TESTKALI/

![](https://i.imgur.com/SO1A5P7.png)

unset TESTKALI

![](https://i.imgur.com/D6hozDG.png)

echo $TESTKALI

![](https://i.imgur.com/Y7qnrYq.png)

nano .bashrc

![](https://i.imgur.com/mYIlVZX.png)

![](https://i.imgur.com/WdrOx4w.png)

source .bashrc

![](https://i.imgur.com/FqYTyvy.png)

echo $TESTKALI

![](https://i.imgur.com/6ClV1Un.png)

В /etc/profile добавил TESTKALI2=/home/kali12345

![](https://i.imgur.com/oDWt54t.png)

source /etc/profile

![](https://i.imgur.com/FqYTyvy.png)

echo $TESTKALI2

![](https://i.imgur.com/irYnKnR.png)
