mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-22 23:51:03 +00:00
69 lines
972 B
Text
69 lines
972 B
Text
= Server setup
|
|
|
|
== Setup scripts
|
|
|
|
`ssh` as `root`:
|
|
|
|
[source,bash]
|
|
----
|
|
ssh root@SERVER_NAME
|
|
----
|
|
|
|
Run the following (as root):
|
|
|
|
[source,bash]
|
|
----
|
|
# Install needed packages
|
|
apt update
|
|
apt install sudo python3 -y
|
|
|
|
# Add a sudo user with the name 'admin'
|
|
sudo useradd admin
|
|
sudo usermod -aG sudo admin
|
|
sudo mkhomedir_helper admin
|
|
|
|
# Enter a new password for 'admin'
|
|
sudo passwd admin
|
|
|
|
# Break the SSH connection
|
|
exit
|
|
----
|
|
|
|
Copy the repository to the server into `/home/admin/advlabdb`.
|
|
|
|
`ssh` again with the new user `admin` and password:
|
|
|
|
[source,bash]
|
|
----
|
|
ssh admin@SERVER_NAME
|
|
----
|
|
|
|
Run the following:
|
|
|
|
[source,bash]
|
|
----
|
|
# Run server setup script
|
|
cd ~/advlabdb
|
|
python3 -m advlabdb.scripts.setup.init_db
|
|
----
|
|
|
|
Change server_name in advlabdb.conf
|
|
|
|
== Stop ssh to root
|
|
// TODO: Add blocking password access
|
|
|
|
IMPORTANT: This step is important for security!
|
|
|
|
Change
|
|
|
|
----
|
|
PermitRootLogin yes
|
|
----
|
|
|
|
to
|
|
|
|
----
|
|
PermitRootLogin no
|
|
----
|
|
|
|
in the config file `/etc/ssh/sshd_config`
|