qnote:linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qnote:linux [2024/04/06 12:56] – [Отключить проверку ssh ключей] k | qnote:linux [2025/07/24 19:52] (current) – [apt via socsk5] k | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Быстрые заметки по Linux ===== | ===== Быстрые заметки по Linux ===== | ||
+ | ==== Про пароли на luks ==== | ||
+ | < | ||
+ | 282 cat / | ||
+ | 286 cryptsetup luksUUID /dev/dm-0 | ||
+ | 287 cryptsetup isLuks /dev/dm-0 | ||
+ | 288 cryptsetup status /dev/dm-0 | ||
+ | 558 history | grep cryp | ||
+ | 559 cat / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # cryptsetup status /dev/dm-0 | ||
+ | /dev/dm-0 is active and is in use. | ||
+ | type: LUKS1 | ||
+ | cipher: | ||
+ | keysize: 512 bits | ||
+ | key location: dm-crypt | ||
+ | device: | ||
+ | sector size: 512 | ||
+ | offset: | ||
+ | size: 37738496 sectors | ||
+ | mode: read/write | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | < | ||
+ | # cryptsetup luksDump /dev/sda3 | ||
+ | LUKS header information for /dev/sda3 | ||
+ | |||
+ | Version: | ||
+ | Cipher name: aes | ||
+ | Cipher mode: | ||
+ | Hash spec: | ||
+ | Payload offset: | ||
+ | MK bits: 512 | ||
+ | MK digest: | ||
+ | MK salt: b2 47 56 fb e1 3d c6 fc d2 8c 8f 81 62 aa a9 70 | ||
+ | |||
+ | MK iterations: 11250 | ||
+ | UUID: 6cac044f-4b9e-f22fb38c59ee | ||
+ | |||
+ | Key Slot 0: ENABLED | ||
+ | Iterations: | ||
+ | Salt: | ||
+ | |||
+ | Key material offset: 8 | ||
+ | AF stripes: | ||
+ | Key Slot 1: DISABLED | ||
+ | Key Slot 2: DISABLED | ||
+ | Key Slot 3: DISABLED | ||
+ | Key Slot 4: DISABLED | ||
+ | Key Slot 5: DISABLED | ||
+ | Key Slot 6: DISABLED | ||
+ | Key Slot 7: DISABLED | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # cryptsetup luksChangeKey /dev/sda3 | ||
+ | Enter passphrase to be changed: | ||
+ | No key available with this passphrase. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # cryptsetup luksChangeKey /dev/sda3 | ||
+ | Enter passphrase to be changed: | ||
+ | Enter new passphrase: | ||
+ | Verify passphrase: | ||
+ | </ | ||
+ | |||
+ | ==== pv ==== | ||
+ | |||
+ | < | ||
+ | pv --rate-limit 10024M </ | ||
+ | </ | ||
==== Генерим трафик через ssh ==== | ==== Генерим трафик через ssh ==== | ||
+ | |||
+ | Исходящий в сторону 10.133.20.191 | ||
< | < | ||
Line 9: | Line 86: | ||
</ | </ | ||
+ | Входящий от 10.133.20.191 | ||
+ | |||
+ | < | ||
+ | root@slv-iperf801: | ||
+ | </ | ||
==== Single mode ==== | ==== Single mode ==== | ||
Line 380: | Line 462: | ||
< | < | ||
[root@noc333 ~]# fail2ban-client set sshd unbanip 1.1.1.1 | [root@noc333 ~]# fail2ban-client set sshd unbanip 1.1.1.1 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@noc333 ~]# fail2ban-client unban --all | ||
</ | </ | ||
Line 520: | Line 606: | ||
==== Посмотреть внешний адрес из консоли ==== | ==== Посмотреть внешний адрес из консоли ==== | ||
+ | < | ||
+ | curl https:// | ||
+ | </ | ||
+ | |||
< | < | ||
curl https:// | curl https:// | ||
Line 1133: | Line 1223: | ||
# date +' | # date +' | ||
22.02.2019 | 22.02.2019 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ date --date "-1 days -8 hours -58 minutes" | ||
+ | 26.09.2024 - 03:01 | ||
</ | </ | ||
Line 1148: | Line 1243: | ||
2021-12-06 05: | 2021-12-06 05: | ||
</ | </ | ||
+ | |||
+ | |||
---- | ---- | ||
Line 1304: | Line 1401: | ||
---- | ---- | ||
- | ==== Удалить ssh ключ из know_hosts ==== | ||
- | |||
- | $ ssh-keygen -f .ssh/ | ||
- | или \\ | ||
- | $ ssh-keygen -f .ssh/ | ||
- | |||
- | ---- | ||
==== exaile на centos6 ==== | ==== exaile на centos6 ==== | ||
Line 1387: | Line 1477: | ||
du -sh * | sort -h | du -sh * | sort -h | ||
du -sh * | sort -h -r | du -sh * | sort -h -r | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Sosks5 ===== | ||
+ | |||
+ | ==== curl via socsk5 ==== | ||
+ | |||
+ | < | ||
+ | # curl -x socks5h:// | ||
+ | </ | ||
+ | |||
+ | ==== apt via socsk5 ==== | ||
+ | |||
+ | < | ||
+ | apt -o Acquire:: | ||
+ | </ | ||
+ | |||
+ | ==== yt-dlp via socsk5 ==== | ||
+ | |||
+ | < | ||
+ | yt-dlp --proxy socks5:// | ||
</ | </ | ||
Line 1457: | Line 1569: | ||
Полезная [[https:// | Полезная [[https:// | ||
+ | |||
+ | ==== Отключить проверку ssh ключей ==== | ||
+ | Для Rancid (система сбора конфигурации с сетевого оборудования) иногда лучше отключить проверку ssh ключей, | ||
+ | |||
+ | Для этого в .ssh/ создаем файл config и для определенных или всех хостов отключаем проверку. | ||
+ | |||
+ | < | ||
+ | [rancid@noc1 ~]$ ll .ssh/config | ||
+ | -rw------- 1 rancid netadm 68 Jul 28 12:17 .ssh/config | ||
+ | [rancid@noc1 ~]$ cat .ssh/config | ||
+ | Host * | ||
+ | StrictHostKeyChecking no | ||
+ | UserKnownHostsFile /dev/null | ||
+ | [rancid@noc1 ~]$ | ||
+ | </ | ||
+ | |||
+ | ==== Удалить ssh ключ из know_hosts ==== | ||
+ | |||
+ | $ ssh-keygen -f .ssh/ | ||
+ | или \\ | ||
+ | $ ssh-keygen -f .ssh/ | ||
qnote/linux.1712397413.txt.gz · Last modified: by k