Change user from marcus to cl

This commit is contained in:
Marcus Kammer 2023-11-01 09:34:31 +01:00
parent 5f58648188
commit 5f1004266d
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -16,8 +16,8 @@ users:
shell: /usr/sbin/nologin
groups: nginxgroup
sudo: null
# Create a new user named 'marcus'
- name: marcus
# Create a new user named 'cl'
- name: cl
# Add the user to the 'users' and 'admin' groups
groups: users, admin
# Allow the user to execute any command with sudo without entering a password
@ -100,7 +100,7 @@ write_files:
# Specifies the command to use for the SFTP subsystem
Subsystem sftp /usr/lib/openssh/sftp-server
# Specifies the user(s) allowed to log in via SSH (in this case, only the user "marcus")
AllowUsers marcus
AllowUsers cl
- path: /etc/fail2ban/jail.local
content: |
@ -272,14 +272,14 @@ write_files:
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
root /home/marcus/www/u1/docs/public;
root /home/cl/www/u1/docs/public;
index index.html;
}
}
write_files:
- path: /home/marcus/setup_git.sh
owner: 'marcus:marcus'
- path: /home/cl/setup_git.sh
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
@ -288,33 +288,33 @@ write_files:
git config --global user.name "Marcus Kammer"
git config --global init.defaultBranch main
- path: /home/marcus/setup_repos.sh
owner: 'marcus:marcus'
- path: /home/cl/setup_repos.sh
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
#!/bin/bash
# Clone the SBCL repository for a specific branch and depth.
# Version is equal to the sbcl version available in ubuntu apt-get repo.
git clone --depth 1 --branch sbcl-2.1.11 git://git.code.sf.net/p/sbcl/sbcl /home/marcus/sbcl
git clone --depth 1 --branch sbcl-2.1.11 git://git.code.sf.net/p/sbcl/sbcl /home/cl/sbcl
# Clone the SLIME repository for a specific branch and depth
git clone --depth 1 --branch v2.28 https://github.com/slime/slime.git /home/marcus/slime
git clone --depth 1 --branch v2.28 https://github.com/slime/slime.git /home/cl/slime
- path: /home/marcus/setup_quicklisp.sh
owner: 'marcus:marcus'
- path: /home/cl/setup_quicklisp.sh
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
#!/bin/bash
# Needs to be run manually, cant be run automatically.
# If runs automatically, `quicklisp.lisp' cant be find by sbcl.
curl https://beta.quicklisp.org/quicklisp.lisp -o /home/marcus/quicklisp.lisp && chown marcus:marcus /home/marcus/quicklisp.lisp
curl https://beta.quicklisp.org/quicklisp.lisp -o /home/cl/quicklisp.lisp && chown marcus:marcus /home/cl/quicklisp.lisp
sbcl --load quicklisp.lisp --non-interactive --eval '(quicklisp-quickstart:install)' --quit
curl https://git.sr.ht/~marcuskammer/cloudinit/blob/main/.sbclrc -o /home/marcus/.sbclrc && chown marcus:marcus /home/marcus/.sbclrc
curl https://git.sr.ht/~marcuskammer/cloudinit/blob/main/.sbclrc -o /home/cl/.sbclrc && chown marcus:marcus /home/cl/.sbclrc
sbcl --non-interactive --eval "(ql:quickload '(:hunchentoot :spinneret :dexador :rove :vecto :woo :clsql-sqlite3))" --quit
- path: /home/marcus/block_openai.sh
owner: 'marcus:marcus'
- path: /home/cl/block_openai.sh
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
@ -333,17 +333,17 @@ write_files:
done < "$file"
[ -f "$file" ] && rm -f "$file"
- path: /home/marcus/setup_user_all.sh
owner: 'marcus:marcus'
- path: /home/cl/setup_user_all.sh
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
#!/bin/bash
/bin/bash /home/marcus/setup_git.sh
/bin/bash /home/marcus/setup_repos.sh
/bin/bash /home/cl/setup_git.sh
/bin/bash /home/cl/setup_repos.sh
- path: /home/marcus/.tmux.conf
owner: 'marcus:marcus'
- path: /home/cl/.tmux.conf
owner: 'cl:cl'
permissions: '0755'
defer: True
content: |
@ -462,5 +462,5 @@ runcmd:
- systemctl enable fail2ban && systemctl start fail2ban
# Restart the SSH server to apply the new configuration
- systemctl restart sshd
- sudo -u marcus /bin/bash /home/marcus/setup_user_all.sh
- sudo -u marcus ssh-keygen -t ed25519 -C "u1.metalisp" -f ~/.ssh/id_ed25519 -N ""
- sudo -u cl /bin/bash /home/cl/setup_user_all.sh
- sudo -u cl ssh-keygen -t ed25519 -C "u1.metalisp" -f ~/.ssh/id_ed25519 -N ""