File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ ## SSH Passwordless Login Using SSH Keygen, [ ref] ( https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps )
2+ ### 1. Environment
3+ Example: SSH password-less automatic login from localhost to Cloudera-VM with user cloudera.
4+ ```
5+ SSH Client : localhost ( MacOS )
6+ SSH Remote Host : 127.0.0.1 ( RedHat - cloudera-vm )
7+ ```
8+
9+ ### 2. Create Authentication SSH-Kegen Keys on Client machine
10+ ``` bash
11+ ssh-keygen -t rsa
12+ ```
13+
14+ ### 3. Create .ssh Directory on Remote machine
15+ ``` bash
16+ ssh cloudera@127.0.0.1 mkdir -p .ssh
17+ ```
18+
19+ ### 4. Upload Generated Public Keys from Client to Remote machine
20+ ``` bash
21+ cat .ssh/id_rsa.pub | ssh cloudera@127.0.0.1 ' cat >> .ssh/authorized_keys'
22+ ```
23+
24+ ### 5. Set Permissions on Remote machine
25+ ``` bash
26+ ssh cloudera@127.0.0.1 " chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
27+ ```
28+
29+ ### 5. Make an alias for Remote server
30+ ``` bash
31+ vi ~ /.ssh/config
32+ ```
33+
34+ * 3022 is forwarding port of 22 from VM to my local machine
35+ ```
36+ Host cloudera-vm
37+ HostName 127.0.0.1
38+ Port 3022
39+ User cloudera
40+ IdentityFile ~/.ssh/id_rsa
41+ ```
42+
43+ ``` bash
44+ ssh cloudera-vm
45+ ```
46+
47+ :boom : Enjoy!
48+
You can’t perform that action at this time.
0 commit comments