SSH: Difference between revisions

565 bytes added ,  3 years ago
m (1 revision imported)
 
(3 intermediate revisions by the same user not shown)
Line 4:
 
== Passwordless SSH Aunthentication ==
ssh-keygen [Press enter key 3 times] # Generate SSH key pair (public + private key)
ssh-copy-id -i ~/.ssh/id_rsa.pub -p 2222 user@example.com # Copy Public key to remote server
user@example.com's password:xxxxxxxxxxx
ssh -p 2222 user@example.com # Test connectivity
 
;Alternative:
 
Add the following to '''.bashrc''' file:
Line 43:
 
sudo service sshd restart
 
== Password from LAN, Key from Internet ==
 
Source: [https://ubuntuforums.org/showthread.php?t=1303735 ubuntuforums.org]
 
sudo nano /etc/ssh/sshd_config
 
# require a key for everybody
PasswordAuthentication no
# any member of the group 'downstairs' can log in without a key
# while connecting from the subnet
Match Address 192.168.0.0/16 Group downstairs
PasswordAuthentication yes