step-by-step: Ubuntu22
Message of the Day) в Ubuntu 24.04:
|
1 2 3 4 |
apt install landscape-common chmod +x /etc/update-motd.d/* touch /root/.Xauthority chmod 600 /root/.Xauthority |
Rsync:
|
1 |
apt install rsync |
Nano:
|
1 |
apt install nano |
Установить английскую локаль:
|
1 2 3 |
locale-gen en_US.UTF-8 update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en localectl set-locale LANG=en_US.UTF-8 |
Заменить путь к репозиторию:
Найдём точное место:
|
1 |
grep -Rni "ru.archive.ubuntu.com" /etc/apt/ |
Выполни точную замену с учётом / в конце:
|
1 2 3 4 5 |
#Ubuntu22: sudo sed -i 's|http://ru.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list #Ubuntu24: sudo sed -i 's|http://ru.archive.ubuntu.com/ubuntu/|http://archive.ubuntu.com/ubuntu/|g' /etc/apt/sources.list.d/ubuntu.sources |
Проверка:
|
1 2 3 4 5 |
#Ubuntu22: cat /etc/apt/sources.list #Ubuntu24: cat /etc/apt/sources.list.d/ubuntu.sources |
Показать количество соединений с каждого IP на порт 443:
|
1 |
ss -Htn state established '( sport = :443 )' | awk '{print $NF}' | sed -E 's/^\[([^]]+)\]:[0-9]+$/\1/; s/:([0-9]+)$//' | sort | uniq -c | sort -nr | head -30 |
step-by-step
►1) Update the firewall to ensure that the system allows incoming connections to the newly specified port. Enter
the following command with your new port:
|
1 |
ufw allow 55522/tcp |
►2) Run the following command to open the sshd_config file:
|
1 |
nano /etc/ssh/sshd_config |
Uncomment:
Port 55522
►3) change password:
|
1 |
passwd |
►4) check time and timezone:
|
1 |
timedatectl |
►5) set timezone:
|
1 |
timedatectl set-timezone Europe/Moscow |
Если не установлены файлы часовых поясов (tzdata) Для Debian / Ubuntu / Proxmox / Hiddify (на базе Ubuntu):
|
1 2 3 4 |
apt update apt install -y tzdata # установить часовой пояс через панель dpkg-reconfigure tzdata |
Если установка tzdata недоступна (например, в урезанном контейнере) Можно «жестко» задать UTC+3 вручную:
|
1 2 |
ln -sf /usr/share/zoneinfo/Etc/GMT-3 /etc/localtime echo "Etc/GMT-3" > /etc/timezone |
►6)full update single line:
|
1 |
apt update && apt upgrade -y |
|
1 |
reboot |
►7) setup base utilites:
|
1 |
sudo apt install -y curl wget unzip git python3 python3-pip ca-certificates lsb-release |
►8) repeat full update and rebot such as paragraph 6.
►9) run install:
|
1 |
bash <(curl https://i.hiddify.com/release) |
10)install netplan:
|
1 |
sudo apt install netplan.io |
►11) apply netplan:
|
1 |
netplan apply |
►12) reboot the server at 6:05 am every day:
|
1 2 |
export EDITOR=nano crontab -e |
|
1 |
05 06 * * * /sbin/shutdown -r +5 |
For example, to restart Hiddify Manager daily at 6:00 AM:
|
1 |
0 6 * * * /bin/bash /opt/hiddify-config/menu.sh restart > /dev/null 2>&1 |