SSH keygen standard
ssh-keygen -t rsa -b 4096
SSH copy id
ssh-copy-id -i ~/.ssh/mykey user@host
Windows Equivalent of ssh-copy-id on Windows Terminal
type $env:USERPROFILE\.ssh\key.pub | ssh [email protected] "cat >> .ssh/authorized_keys"
Allowing SFTP but disallowing SSH
Subsystem sftp internal-sftp
And then block other uses:
Match group sftponly
ChrootDirectory /upload/%u
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
ForceCommand internal-sftp