HCS uses SSH to connect to your server and deploy your application, even if you are using only the localhost server - where HCS is running on.
To validate your configuration, make sure the followings are set on your server.
Some commands may vary based on your Linux distribution.
Make sure the SSH key does not have a passphrase. Connection will fail if the key has a passphrase.
SSH Enabled
Make sure SSH is enabled and you can connect to your server with SSH from your local machine with root user.
# Ubuntu/Debian
sudo apt install openssh-server
sudo systemctl status sshd
# CentOS/RHEL
sudo yum install openssh-server
sudo systemctl status sshd
# Arch Linux
sudo pacman -S openssh
sudo systemctl status sshd
# Alpine Linux
sudo apk add openssh
sudo rc-service sshd status
# SLES/openSUSE
sudo zypper install openssh
sudo systemctl status sshd
Root Login
Make sure PermitRootLogin is set to yes or without-password or prohibit-password in /etc/ssh/sshd_config file.
# Check the current value
grep PermitRootLogin /etc/ssh/sshd_config
# If the value is not `yes` or `without-password` or `prohibit-password`, change it and make sure it is not commented out.
# If it is commented out, remove the `#` character at the beginning of the line.
sudo vi /etc/ssh/sshd_config
# You can exit the editor by pressing `Esc` and then `:wq` and then `Enter` keys - thank me later.
# Restart the SSH service
# Ubuntu/Debian/CentOS/RHEL/Arch Linux/SLES/openSUSE
sudo systemctl restart sshd
# Alpine Linux
sudo rc-service sshd restart
SSH Key set on the Server
Make sure an SSH key is added to the ~/.ssh/authorized_keys file. If you installed HCS with the automated script, you don’t need to do anything else.
If you installed HCS manually, you need to add an SSH key to the ~/.ssh/authorized_keys file.
Make sure the SSH key does not have a passphrase. Connection will fail if the key has a passphrase.
# Create a new SSH key pair ed25519 (recommended) or rsa (legacy) with the following command.
# The key needs to be created in the `/data/HCS/ssh/keys` directory with,
# id.root@host.docker.internal name,
# no passphrase,
# root@HCS comment.
ssh-keygen -t ed25519 -a 100 -f /data/HCS/ssh/keys/id.root@host.docker.internal -q -N "" -C root@hcs
chown 9999 /data/HCS/ssh/keys/id.root@host.docker.internal
# Copy the public key to the `authorized_keys` file
cat /data/HCS/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys
# Set the correct permissions
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
SSH Key set in HCS
Add the private key to HCS at Keys & Tokens menu -> Private Keys and set this new key in the localhost server settings.