Канал для системных администраторов или те кто работает в ИТ сфере.
📚КНИГИ ПО
💠Cisco systems
💠Mikrotik
💠VoIP
💠Linux
💠 Windows server
💠 Сетевые технологии
📽Видеоуроки
🤝Поддержка
Наша группа: @SySAD
Feedback bot: @SySADbot
Post #11139
983
СИ Showing posts older than #11141 · Back to latest


Forwarded from Про100ИТ


find /path/to/dir -name "*.txt"
find /path/to/dir -type d
find /path/to/dir -type f -size +100M
find /path/to/dir -mtime -7
find /path/to/dir -exec rm {} \;find /path/to/dir -perm 644
find /path/to/dir -user username
find /path/to/dir -empty
find /path/to/dir -name "*.log" -exec grep "error" {} \;find /path/to/dir -name "*.tmp" -delete
# Подключение к серверу
ssh user@host
# Копирование файла
scp file.txt user@host:/path/
# SFTP-сессия
sftp user@host
# Синхронизация директорий
rsync -avz -e ssh /local/path user@host:/remote/path
/etc/ssh/sshd_configPort 2222 # Меняем порт
PermitRootLogin no # Запрет root-входа
PasswordAuthentication no # Только по ключам
MaxAuthTries 3 # Лимит попыток входа
AllowUsers admin user1 # Белый список пользователей
systemctl restart sshd
# Генерация ключа
ssh-keygen -t ed25519 -C "admin@myserver"
# Установка ключа на сервер
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host
apt install fail2ban # Debian/Ubuntu
yum install fail2ban # CentOS/RHEL
systemctl enable --now fail2ban
/etc/fail2ban/jail.local:[sshd]
enabled = true
port = 2222
filter = sshd
maxretry = 3
bantime = 3600
ufw allow 2222/tcp
ufw enable
ufw status
iptables -A INPUT -p tcp --dport 2222 -j ACCEPT
iptables -A INPUT -j DROP
firewall-cmd --permanent --add-port=2222/tcp
firewall-cmd --reload