From 1b65eb4e045a194779e9e5582d3eeedccca2b6b2 Mon Sep 17 00:00:00 2001 From: Vikyath Harekal Date: Mon, 4 Nov 2024 14:45:25 +0000 Subject: [PATCH] feat: [CDE-332]: Sudo no password (#2918) * feat: [CDE-332]: Sudo no password --- app/gitspace/orchestrator/template/templates/manage_user.sh | 2 ++ .../orchestrator/template/templates/setup_ssh_server.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/gitspace/orchestrator/template/templates/manage_user.sh b/app/gitspace/orchestrator/template/templates/manage_user.sh index 953dd5a16..5814961d9 100644 --- a/app/gitspace/orchestrator/template/templates/manage_user.sh +++ b/app/gitspace/orchestrator/template/templates/manage_user.sh @@ -18,10 +18,12 @@ else apt-get update && apt-get install -y adduser adduser --disabled-password --home "$homeDir" --gecos "" "$username" usermod -aG sudo "$username" + echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers ;; fedora) useradd -m -d "$homeDir" "$username" usermod -aG wheel "$username" + echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers ;; opensuse) useradd -m -d "$homeDir" "$username" diff --git a/app/gitspace/orchestrator/template/templates/setup_ssh_server.sh b/app/gitspace/orchestrator/template/templates/setup_ssh_server.sh index c5b48a241..f57f7f999 100644 --- a/app/gitspace/orchestrator/template/templates/setup_ssh_server.sh +++ b/app/gitspace/orchestrator/template/templates/setup_ssh_server.sh @@ -73,4 +73,4 @@ if ! grep -q "^PasswordAuthentication yes" $config_file; then fi fi -mkdir /var/run/sshd \ No newline at end of file +mkdir -p /var/run/sshd \ No newline at end of file