How to set key based authentication in remote machine

0 votes

I have my server-client scenario for my project. Server is in remote desktop. But every time I am running some program in my remote server, it asks me password. It is good for security purpose, but it takes time. 

Is there any way so that it will not ask password every time?

Thank You 

Apr 1, 2020 in Linux Administration by akhtar
• 38,230 points
476 views

1 answer to this question.

0 votes

Hi@akhtar,

You can set key based authentication in your server machine. For that you have to create one ssh key and copy that key in your remote system.

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:uvGnlxsbPHSD99b2qQ/Oe0fNcYVtSf+q5WitlkpyXj8 root@master
The key's randomart image is:
+---[RSA 2048]----+
|              .+.|
|              ..=|
|               .o|
|           .   .o|
|        S o +  .=|
|       . o o o o+|
|      o . B..+=.o|
|       + =+**BEo+|
|      . o+==+*B+o|
+----[SHA256]-----+

$ ssh-copy-id 'remote ip'

Now, you can able to run your program without any password.
Thank You

answered Apr 1, 2020 by MD
• 95,440 points

Related Questions In Linux Administration

0 votes
2 answers

How do I use a shell script to SSH in to a remote machine to execute commands?

Sorry in advance for any formatting. Check out ...READ MORE

answered Feb 7, 2021 in Linux Administration by anonymous
16,729 views
0 votes
1 answer

How to increase Swap Memory in CentOS 7?

Follow the below steps and procedures: Prerequisites Must have ...READ MORE

answered Oct 5, 2018 in Linux Administration by Frankie
• 9,830 points
15,399 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,210 points
2,092 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,210 points
857 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
960 views
+6 votes
17 answers

What are job opportunities as a Linux System Administrator?

I just started working professionally as a ...READ MORE

answered Jul 19, 2018 in Career Counselling by eatcodesleeprepeat
• 4,710 points
10,293 views
0 votes
1 answer

AWS Simple AD : SSH based key Authentication for Linux instances

You can interact with SimpleAD in the ...READ MORE

answered Aug 29, 2018 in AWS by Priyaj
• 58,090 points
851 views
0 votes
1 answer

How to run GUI program in SSH server from remote desktop?

Hi@akhtar, First you have to configure SSH server ...READ MORE

answered Mar 31, 2020 in Linux Administration by MD
• 95,440 points
4,190 views
0 votes
1 answer

How to find Resident Set Size of a process in Linux?

Hi@akhtar, RSS is a memory currently used by ...READ MORE

answered Oct 12, 2020 in Linux Administration by MD
• 95,440 points
1,343 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP