mirror of
https://github.com/darksaid98/ubuntu-server-setup.git
synced 2026-12-02 06:28:59 +00:00
Added sshd_config modifications
This commit is contained in:
1 parent
2779c7f3ee
commit
9ef673594e
3 files changed
+42
-2
No files matched your search
@@ -29,4 +29,14 @@ function execAsUser() {
|
||||
local exec_command=${2}
|
||||
|
||||
sudo -u "${username}" -H sh -c "${exec_command}"
|
||||
}
|
||||
|
||||
function changeSSHConfig() {
|
||||
sudo sed -re 's/^(\#?)(PasswordAuthentication)([[:space:]]+)yes/\2\3no/' -i.$(echo 'old') /etc/ssh/sshd_config
|
||||
sudo sed -re 's/^(\#?)(PermitRootLogin)([[:space:]]+)(.*)/PermitRootLogin no/' -i /etc/ssh/sshd_config
|
||||
}
|
||||
|
||||
function setupUfw() {
|
||||
sudo ufw allow OpenSSH
|
||||
yes y | sudo ufw enable
|
||||
}
|
||||
Reference in new issue
Block a user