Files
obsidian-vault-/Linux/CLI/СLI Network SSH and other.md
T

78 lines
1.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#os #command #linux #DeviceTree #system
## Boot оr UBoot
---
## SSH - control
Настройка доступа по ключу с использованием файла `./ssh/config`
- Сгенерировать ключ (на локальном хосте)
`ssh-keygen -t ed25519`
- Приватный ключ: `~/.ssh/id_ed25519`
- Публичный ключ: `~/.ssh/id_ed25519.pub`
Добавить `pub` ключ на сервер (_`~/.ssh/authorized_keys`_)
1. Если файл с директорией не существует - создать
2. Можно использовать `ssh-copy-id`
Добавить конфигурацию в **./ssh/config**
``` python
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
# Port Forward <локальный порт - целевой хост - целевой порт>
Host MyServer
    HostName 192.168.1.110
    User emb
IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
    Port 22
LocalForward 5432 10.0.0.5:5432
```
Порты для проброса:
1. RDP - **3389**
2. VNC - **5900**
3. SSH - **22**
4. Telnet - **23**
5. HTTP/HTTPS - **80 / 443**
Используемые команды:
Генерация ssh ключа:
```bash
ssh-keygen -t ed25519
```
Проброс портов в localhost:
```bash
ssh -L 5901:10.10.10.5:5900 user@192.168.10.1
```
Копирование файлов на удаленный сервер
```bash
scp file.txt root@192.168.1.1:/user/home/workspace
```
---
## Network
Настройка сети и интерфейсов
```bash
ifconfig
ifconfig eth0 down
```
Проверка маршрута следования трафика.
``` bash
traceroute
```
Cписок все IP адресов сетевых интерфейсов:
``` bash
ip a
```
## Hardware
Получение информации о оборудовании.
```bash
lshw
```