Cloudflare SSH Setup
Cloudflare Setup
This short Setup shows how to Setup Cloudflare SSH Access when cloudflared is already installed.
create a new sshd Config for Cloudflare:
sh code snippet start
sudo nano /etc/ssh/sshd_config.d/90-cloudflare.confsh code snippet end
Add:
code snippet start
PasswordAuthentication no PubkeyAuthentication yes TrustedUserCAKeys /etc/ssh/ca.pubcode snippet end
Add the generated Public Key from Cloudflare Get the key from Zero Trust > Access > Service auth > SSH > Generate certificate Write it into /etc/ssh/ca.pub Ensure it has the correct rights:
code snippet start
sudo chmod 600 /etc/ssh/ca.pubcode snippet end
Reload ssh
code snippet start
sudo systemctl reload sshcode snippet end
optional step
Allow passwordless sudo because there are no passwords
sh code snippet start
sudo visudosh code snippet end
replace
%sudoline withcode snippet start
%sudo ALL=(ALL:ALL) NOPASSWD: ALLcode snippet end
Create users like this
sh code snippet start
export NEW_USER=username sudo useradd -m -s /bin/bash $NEW_USER sudo usermod -aG sudo $NEW_USER sudo usermod -aG docker $NEW_USERsh code snippet end
See