sudo systemctl enable ssh.service
sudo systemctl start ssh.service
With that you can login with the osmc user.
create /.ssh/authorized_keys and copy public key with the osmc user
chmod 700 /home/osmc/.ssh
chmod 644 /home/osmc/.ssh/authorized_keys
from local linux system:
cat ~/.ssh/id_rsa.pub | ssh [email protected] 'mkdir .ssh/ && cat >> .ssh/authorized_keys'
To force mapping on your router:
login in your server and run:
sudo apt-get install miniupnpc
upnpc -e "ssh external" -a `ip route get 8.8.8.8 | awk '{print $NF; exit}'` 2223 23 TCP
Open up the SSHD config file
sudo nano /etc/ssh/sshd_config
Change these parameters to no
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
Reload SSHD
sudo systemctl restart ssh.service
read: https://www.jaredwolff.com/blog/passwordless-ssh-raspberry-pi/