PublicKeyAuthentication
keygen
1
|
ssh-keygen -t ed25519 -C "comment"
|
authorized_keys
1
2
|
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
#chmod 644 ~/.ssh/authorized_keys
|
ssh config
/etc/ssh/sshd_config
1
2
3
4
5
6
|
Port 22
PermitRootLogin no
#PermitRootLogin prohibit-password
PubkeyAuthentication yes
PasswordAuthentication no
#AllowUsers user1 user2
|
GatewayPorts
Allow remote port forwarding to bind 0.0.0.0
.
ssh config
/etc/ssh/sshd_config
sudo nopasswd
1
|
echo "user1 ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|