mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git
synced 2024-11-16 13:43:20 +00:00
3.5 KiB
3.5 KiB
title | linkTitle | weight | date | description |
---|---|---|---|---|
How to get root access via SSH | Root access via SSH | 1 | 2023-03-14 | If you need to manually perform some tasks, you can get root access via SSH. |
To access your server's root shell you will have to generate your SSH key and add it to your server's authorized keys.
How to generate SSH key
{{< tabpane text=true >}} {{% tab "Unix-like systems (PC)" %}}
If you are a Unix-like system user
- Open the terminal.
- Run the following command:
You will be asked to enter a passphrase. You can leave it empty, but it is recommended to use a passphrase. If you do not want to use a passphrase, press Enter.ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
- Print the public key to the terminal and copy it:
cat ~/.ssh/id_ed25519.pub
- Refer to the next section to add the key to your server.
{{% /tab %}}
{{% tab "Windows" %}}
If you are a Windows user
- Open settings and under "Applications" click on "Manage additional components".
- Press "Add Component".
- Enter "OpenSSH client" in the search box and install it.
- Open the Command Prompt. You can do this by pressing Win+R, typing
cmd
and pressing Enter. - Run the following command, replacing
user_name
with your Windows username:
You will be asked to enter a passphrase. You can leave it empty, but it is recommended to use a passphrase. If you do not want to use a passphrase, press Enter.ssh-keygen -t ed25519 -f C:\Users\user_name\.ssh\id_ed25519
- Print the public key to the terminal and copy it:
Once again, replacetype C:\Users\user_name\.ssh\id_ed25519.pub
user_name
with your Windows username. - Refer to the next section to add the key to your server.
{{% /tab %}}
{{% tab "Android (Termux)" %}}
If you are a Android (Termux) user
- Install Termux. We recommend installing it from F-Droid.
- Open Termux.
- Run the following command:
You will be asked to enter a passphrase. You can leave it empty, but it is recommended to use a passphrase. If you do not want to use a passphrase, press Enter.apt update -y && apt upgrade -y && apt install open-ssh -y && ssh-keygen -t ed25519 -f /data/data/com.termux/files/usr/etc/ssh/ssh_host_ed25519_key
- Print the public key to the terminal and copy it:
cat /data/data/com.termux/files/usr/etc/ssh/ssh_host_ed25519_key.pub
- Refer to the next section to add the key to your server.
{{% /tab %}} {{< /tabpane >}}
How to add the key to your server
- Open the SelfPrivacy app.
- Go to the "More" tab.
- Tap on "Superuser SSH keys".
- Tap on the "Create SSH key" button.
- Paste the public key you copied earlier.
- Tap on the "Create SSH key" button.
- Open the Jobs list
- Tap on the "Start" button.
- In a few minutes, you will be able to access your server's root shell via SSH.
{{< imgproc more-superuser Fill "1001x808" />}}
How to access your server's root shell via SSH
- Open the terminal or Command Prompt.
- Run the following command, replacing
server_domain
with your server's domain:ssh root@server_domain
- Enter the passphrase you entered when generating the SSH key, if you used one.
Be careful when using the root shell. If you do not know what you are doing, you can break your server or leak your data. Responsibility for the consequences of your actions lies with you. Respect the privacy of other users.