Difference between revisions of "Internet Offline: automatic ssh remote login"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Buat id_dsa.pub | + | Buat id_dsa.pub & id_rsa.pub |
chmod 700 ~/.ssh | chmod 700 ~/.ssh | ||
ssh-keygen -t dsa | ssh-keygen -t dsa | ||
+ | ssh-keygen -t rsa | ||
ssh-copy-id user@machine | ssh-copy-id user@machine | ||
ssh-copy-id pi@192.168.0.1 | ssh-copy-id pi@192.168.0.1 | ||
+ | ssh pi@192.168.0.1 'chmod -R go= ~/.ssh' | ||
+ | ssh pi@192.168.0.1 'chown -R pi:pi ~/.ssh' | ||
+ | |||
Alternative yang lebih panjang:( | Alternative yang lebih panjang:( | ||
Line 11: | Line 15: | ||
ssh pi@192.168.0.1 'touch ~/.ssh/authorized_keys' | ssh pi@192.168.0.1 'touch ~/.ssh/authorized_keys' | ||
cat ~/.ssh/id_dsa.pub | ssh pi@192.168.0.1 'cat >> ~/.ssh/authorized_keys' | cat ~/.ssh/id_dsa.pub | ssh pi@192.168.0.1 'cat >> ~/.ssh/authorized_keys' | ||
+ | cat ~/.ssh/id_rsa.pub | ssh pi@192.168.0.1 'cat >> ~/.ssh/authorized_keys' | ||
+ | |||
+ | Lakukan hal sebaliknya dari server ke client .. supaya aman aja .. | ||
Latest revision as of 08:14, 17 December 2018
Buat id_dsa.pub & id_rsa.pub
chmod 700 ~/.ssh ssh-keygen -t dsa ssh-keygen -t rsa ssh-copy-id user@machine ssh-copy-id pi@192.168.0.1 ssh pi@192.168.0.1 'chmod -R go= ~/.ssh' ssh pi@192.168.0.1 'chown -R pi:pi ~/.ssh'
Alternative yang lebih panjang:(
ssh pi@192.168.0.1 'mkdir .ssh' ssh pi@192.168.0.1 'touch ~/.ssh/authorized_keys' cat ~/.ssh/id_dsa.pub | ssh pi@192.168.0.1 'cat >> ~/.ssh/authorized_keys' cat ~/.ssh/id_rsa.pub | ssh pi@192.168.0.1 'cat >> ~/.ssh/authorized_keys'
Lakukan hal sebaliknya dari server ke client .. supaya aman aja ..