skript setup opraven
This commit is contained in:
parent
737cd10268
commit
cd77719bed
@ -50,9 +50,12 @@ echo "y" | sudo ufw enable
|
|||||||
|
|
||||||
# Změna SSH konfigurace
|
# Změna SSH konfigurace
|
||||||
sudo sed -i "s/#Port 22/Port $SSH_PORT/" /etc/ssh/sshd_config
|
sudo sed -i "s/#Port 22/Port $SSH_PORT/" /etc/ssh/sshd_config
|
||||||
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
|
sudo sed -i 's/#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||||
|
sudo sed -i 's/PermitRootLogin .*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||||
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
|
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
|
||||||
|
sudo sed -i 's/PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config
|
||||||
sudo sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config
|
sudo sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config
|
||||||
|
sudo sed -i 's/PubkeyAuthentication .*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
|
||||||
|
|
||||||
# Restart SSH služby, aby se změny projevily
|
# Restart SSH služby, aby se změny projevily
|
||||||
if systemctl list-units --type=service | grep -q "ssh.service"; then
|
if systemctl list-units --type=service | grep -q "ssh.service"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user