Setup SSH Server on Pod

Clone a public Template like Ubuntu 22.04 and modify the docker options to include -p 22:22 to expose port 22 to the internet.

Connect to the pod using webssh

//run the following commands

apt update

apt install openssh-server vim

cd /etc/ssh

vi sshd_config

//uncomment the lines

#PermitRootLogin prohibit-password

#PasswordAuthentication yes

save the file with Esc followed by :wq!

//restart sshd with

service ssh restart

//go to /root/.ssh

//and paste the contents of your public_key in file authorized_keys

chmod 600 authorized_keys

connect using default key file

ssh -p EXPOSED_PORT root@POD_PUBLIC_IP

replace EXPOSED_PORT with the port mapping for 22 port and use the POD_PUBLIC_IP from connect popup

e.g. ssh -p 42502 root@136.61.33.107

if your key is not in the default loation you can specify the key using -i

e.g.

ssh -p 42502 root@136.61.33.107 -i key.pem

Last updated