SSH Enable Without Password Authentication On Ubuntu 14.04/16.045 min read
SSH means secure shell network protocol system. SSH system default connection port 22. If you can change to another using port for security purposes. So I have to show SSH enable without password authentication. It’s very important think if you can mysql DB replication then must be ssh enable without password authentication.
★ How To Upgrade Zabbix Server From 3.2.6 To 3.4.1
★ How To Setup CHAN SIP Trunk
Requirements :
- ssh must enable
- any firewall disable
- Hosts file localhost comment out
#127.0.0.1 localhost 10.66.50.1 SSH-1
Server -1 configuration for enable ssh without password authentication
root@SSH-1:~# mkdir .ssh
Goto .ssh/ directory
root@SSH-1:~# cd .ssh/
Run command ssh-keygen
root@SSH-1:~/.ssh# ssh-keygen
Press Enter four times. See as like below image
root@SSH-1:~/.ssh# cat id_rsa.pub
See example below
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC02n91bcmnAsiNuHgOvMdlxmh2 OIwq9jJriiEv3B1TJhsTvcRfYVB6aldxEpW8V9NdBVXzt9BsA/xHb6Znz04pdFrZ 8m17osc7pqV7Diu3lM/GZfK80F64ttpA152M0ztLb6i+b4EBfC4DkJkB6ONccGIa W8Jyj6f+Pzhd2E3pLQIDAQAB root@SSH-1
Then collect all text for add another server. Goto Server 2 and create authorized_keys file and then insert all authorized_keys from Server 1.
Now create full permission .ssh directory and authorized_keys file.
root@SSH-1:~# chmod 755 .ssh
Setup permission authorized_keys file.
root@SSH-1:~/.ssh# chmod 755 authorized_keys
Service ssh restart command or your server reboot needed.
root@SSH-2:~# service ssh restart
Server -2 configuration for enable ssh without password authentication
root@SSH-2:~# mkdir .ssh
Goto .ssh/ folder
root@SSH-2:~# cd .ssh/
Run ssh-keygen command
root@SSH-2:~/.ssh# ssh-keygen
Press Enter four times. See as like below image.
root@SSH-2:~/.ssh# cat id_rsa.pub
See example below:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO2DJevIWe2tKnlK8ffJaPcuQn 48Ydhm8GlXP8Rdb2GleX32ib7aJo/tc35+yUqGkkJ7edzRAThnnC88q4KXTTPIYQ gzFyQ8DICOiFmbAtIK8yT8OlLkC8ZzROFyeh3mwfS1UxsSi5Sba/8e76nzGQ45nn 1eYnk+diWM8I46U84QIDAQAB root@SSH-2
Then collect all text for add another server. Goto Server 1 and create authorized_keys file and then insert all authorized_keys from Server 2.
Now create full permission .ssh directory and authorized_keys file.
root@SSH-2:~# chmod 755 .ssh
Setup permission authorized_keys file.
root@SSH-2:~/.ssh# chmod 755 authorized_keys
ssh service restart or server reboot needed.
root@SSH-2:~# service ssh restart
Test from Server -2
root@SSH-2:~# ssh -l root 10.66.50.1
Write Yes then press Enter. Now login Server -1 from Server -2 without password authentication.
Goto Server -1 for test.
root@SSH-1:~# ssh -l root 10.66.50.2
Write Yes then press Enter. Now login Server -2 from Server -1 without password authentication.
Now ready for main task mysql DB replication.
If face any problem then see my YouTube video and Subscribe my channel. Please subscribe my channel for more update.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!