Skip to content

Commit ab90f94

Browse files
author
xtutran
committed
passwordless ssh
1 parent ee39354 commit ab90f94

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

ssh/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+

0 commit comments

Comments
 (0)