mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
Fixes
- Fix prometheus files path - Fix sciprt allowing to execute w/out username param - Add oh-my-zsh installation - Fix typo un ssh authorized_keys file - Fix PermitRootLogin disabling
This commit is contained in:
@@ -9,10 +9,10 @@ function config_ssh() {
|
||||
sudo mkdir -p $ssh_dir
|
||||
sudo chmod 700 $ssh_dir
|
||||
|
||||
sudo touch "$ssh_dir/authorized_leys"
|
||||
sudo chmod 600 "$ssh_dir/authorized_leys"
|
||||
sudo touch "$ssh_dir/authorized_keys"
|
||||
sudo chmod 600 "$ssh_dir/authorized_keys"
|
||||
sudo chown -R "$username:$username" $ssh_dir
|
||||
echo "[ SSH ]: Created ~/.ssh/authorized_leys"
|
||||
echo "[ SSH ]: Created ~/.ssh/authorized_keys"
|
||||
|
||||
echo "[ SSH ]: Paste the public key for $username (leave empty to skip)"
|
||||
read -r public_key
|
||||
@@ -24,7 +24,7 @@ function config_ssh() {
|
||||
fi
|
||||
|
||||
echo "[ SSH ]: Disabling root login"
|
||||
sudo sed -i 's/^#PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||
echo "[ SSH ]: Root login disabled"
|
||||
|
||||
echo "[ SSH ]: Adding $username to allowed users"
|
||||
|
||||
Reference in New Issue
Block a user