<img src="https://makerhacks.com/wp-content/uploads/2018/03/bigstock-Choosing-the-key-to-success-fr-149892281.jpg" alt="Password-Less SSH Login Linux" width="723" height="527" /><br> If you are logging in and out of a Linux machine, especially a Raspberry Pi on your local network, it can be a pain to keep entering a password. The longer and more secure your password, the more of a pain it can be. If only there was a secure but convenient alternative ... Well, there is! <h3>SSH and Public Keys</h3> What we are going to do is set up a trusted kind of authentication for our shell access between the two computers. Technically we are creating what is called a "2048 bit RSA key pair". A bit like a super-password that you don't have to type in every time :) <h3>The Steps</h3> First, we need to see if you already have a key on your local machine by logging into your local terminal and using: <code>ls ~/.ssh</code> If you don't see a .pub file then you need one extra step. Enter: <code>ssh-keygen </code> to create one (just accepting the defaults is fine as prompted, unless you are more knowledgeable). You will get a couple of new files. <strong>id_rsa.pub</strong> is your public key, which is what you share with the world. Keep any other files private, especially your <strong>id_rsa</strong>, which is your private key. Next, you need to output your file to the terminal so you can copy it to your clipboard, or you can FTP it up to the server if that is easier. <code>cat ~/.ssh/id_rsa.pub</code> Copy and paste to the terminal as part of this command: <code>echo ssh-rsa [YOUR COPYPASTE HERE] >> ~/.ssh/authorized_keys</code> This appends the key to your Authorized Keys file, essentially saying you get to log in without entering a password in future :) (If the directory does not exist then <code>mkdir ~/.ssh</code> and try again) Finally, set the permissions: <code>chmod 600 ~/.ssh/authorized_keys</code> That's it, you should now have freedom from passwords, at least between those two SSH terminals ;) <div> <ul> <li><sub>Image Source: BigStock</sub></li> </ul></div><br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : https://makerhacks.com/ssh-linux-raspberrypi-public-keys/</em><hr/></center>
author | makerhacks | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
permlink | password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g | ||||||||||||
category | geek | ||||||||||||
json_metadata | {"community":"steempress","app":"steempress/1.0.1","tags":["geek","linux","making","programming","technology"]} | ||||||||||||
created | 2018-03-03 00:21:54 | ||||||||||||
last_update | 2018-03-03 00:21:54 | ||||||||||||
depth | 0 | ||||||||||||
children | 7 | ||||||||||||
last_payout | 2018-03-10 00:21:54 | ||||||||||||
cashout_time | 1969-12-31 23:59:59 | ||||||||||||
total_payout_value | 31.668 HBD | ||||||||||||
curator_payout_value | 1.006 HBD | ||||||||||||
pending_payout_value | 0.000 HBD | ||||||||||||
promoted | 0.000 HBD | ||||||||||||
body_length | 2,351 | ||||||||||||
author_reputation | 156,977,359,570,955 | ||||||||||||
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" | ||||||||||||
beneficiaries |
| ||||||||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||||||||
percent_hbd | 10,000 | ||||||||||||
post_id | 41,753,254 | ||||||||||||
net_rshares | 8,054,337,419,657 | ||||||||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xaero1 | 0 | 5,934,923,278,811 | 46% | ||
drac59 | 0 | 1,863,506,054 | 90% | ||
rawpride | 0 | 15,889,123,175 | 25% | ||
howo | 0 | 109,374,205,395 | 100% | ||
themarkymark | 0 | 13,158,139,370 | 25% | ||
taukproung85 | 0 | 131,879,685 | 100% | ||
niallon11 | 0 | 35,359,775,215 | 100% | ||
holbein81 | 0 | 644,388,030,833 | 100% | ||
hairshares | 0 | 224,434,317,800 | 100% | ||
bssman | 0 | 2,152,140,154 | 20% | ||
makerhacks | 0 | 32,581,619,453 | 100% | ||
drmake | 0 | 76,842,441,482 | 100% | ||
mytechtrail | 0 | 606,816,060 | 100% | ||
geekpowered | 0 | 33,083,973,539 | 100% | ||
mazcity | 0 | 476,653,031 | 100% | ||
imanisraelirick | 0 | 873,334,170,906 | 100% | ||
zoelviana | 0 | 317,675,204 | 100% | ||
synergysteem | 0 | 1,213,629,810 | 100% | ||
niduroki | 0 | 614,267,857 | 100% | ||
tolgahanuzun | 0 | 3,156,538,591 | 100% | ||
dshelton32 | 0 | 27,159,321,164 | 100% | ||
geekahol | 0 | 4,277,091,149 | 100% | ||
throwawayaccount | 0 | 0 | 100% | ||
steempress-io | 0 | 13,510,257,882 | 16.66% | ||
builduino | 0 | 113,526,398 | 100% | ||
davincibot | 0 | 113,791,046 | 100% | ||
loveyourstyle | 0 | 113,526,361 | 100% | ||
canuckbot | 0 | 115,367,312 | 100% | ||
tpvoter1 | 0 | 134,842,098 | 100% | ||
sbi3 | 0 | 543,532,296 | 1% | ||
steemtux | 0 | 2,082,497,736 | 100% | ||
anatere | 0 | 257,422,060 | 100% | ||
fel1xw | 0 | 365,190,404 | 100% | ||
mrnielsb | 0 | 571,544,244 | 100% | ||
mrfrenchy | 0 | 596,259,627 | 100% | ||
palermo | 0 | 481,067,455 | 100% |
Better to type in password often, what if your machine stole or another user get an access your super user now is on the risk.
author | cloudspyder | ||||||
---|---|---|---|---|---|---|---|
permlink | re-makerhacks-201833t93550548z | ||||||
category | geek | ||||||
json_metadata | {"tags":["geek","linux","making","programming","technology"],"app":"esteem/1.5.1","format":"markdown+html","community":"esteem"} | ||||||
created | 2018-03-03 01:35:57 | ||||||
last_update | 2018-03-03 01:35:57 | ||||||
depth | 1 | ||||||
children | 1 | ||||||
last_payout | 2018-03-10 01:35:57 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.000 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 126 | ||||||
author_reputation | 8,281,689,777,163 | ||||||
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 41,764,855 | ||||||
net_rshares | 0 |
If someone gets physical access to my machine and manages to log into it then I have bigger problems than my dev server being logged into ...
author | makerhacks |
---|---|
permlink | re-cloudspyder-re-makerhacks-201833t93550548z-20180303t013718297z |
category | geek |
json_metadata | {"tags":["geek"],"app":"steemit/0.1"} |
created | 2018-03-03 01:37:18 |
last_update | 2018-03-03 01:37:18 |
depth | 2 |
children | 0 |
last_payout | 2018-03-10 01:37:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 141 |
author_reputation | 156,977,359,570,955 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 41,765,054 |
net_rshares | 0 |
Interesting information........ Please upvote my comment and post......
author | mrshahriar |
---|---|
permlink | re-makerhacks-password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g-20180303t050054311z |
category | geek |
json_metadata | {"tags":["geek"],"app":"steemit/0.1"} |
created | 2018-03-03 05:00:57 |
last_update | 2018-03-03 05:00:57 |
depth | 1 |
children | 0 |
last_payout | 2018-03-10 05:00:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 73 |
author_reputation | 90,672,800,320 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 41,797,935 |
net_rshares | 0 |
I always use keys with SSH, and always turn off ssh password auth. Especially on servers that are open to the Internet. Also `chmod 700 ~/.ssh` to make sure the .ssh directory is only writeable by you.
author | steemtux |
---|---|
permlink | re-makerhacks-password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g-20180303t011728959z |
category | geek |
json_metadata | {"tags":["geek"],"app":"steemit/0.1"} |
created | 2018-03-03 01:17:30 |
last_update | 2018-03-03 01:17:30 |
depth | 1 |
children | 0 |
last_payout | 2018-03-10 01:17:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 202 |
author_reputation | 170,129,148,681 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 41,762,046 |
net_rshares | 3,145,811,533 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
makerhacks | 0 | 3,145,811,533 | 10% |
Have a look at the command: ``` $ ssh-copy-id user@box.com ```
author | throwawayaccount |
---|---|
permlink | re-makerhacks-password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g-20180310t062314145z |
category | geek |
json_metadata | {"tags":["geek"],"app":"steemit/0.1"} |
created | 2018-03-10 06:23:33 |
last_update | 2018-03-10 06:23:33 |
depth | 1 |
children | 0 |
last_payout | 2018-03-17 06:23:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 63 |
author_reputation | -479,586,892,695 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 43,462,707 |
net_rshares | 1,689,992,159 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
makerhacks | 0 | 1,689,992,159 | 4% |
Here are some links for those interested that are related to this post: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys This series of tutorial from the funtoo guys is very cool if you want to understand the topic in more depth: https://www.funtoo.org/OpenSSH_Key_Management,_Part_1 https://www.funtoo.org/OpenSSH_Key_Management,_Part_2 https://www.funtoo.org/OpenSSH_Key_Management,_Part_3
author | throwawayaccount |
---|---|
permlink | re-makerhacks-password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g-20180310t063027220z |
category | geek |
json_metadata | {"tags":["geek"],"links":["https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2","https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys","https://www.funtoo.org/OpenSSH_Key_Management,_Part_1","https://www.funtoo.org/OpenSSH_Key_Management,_Part_2","https://www.funtoo.org/OpenSSH_Key_Management,_Part_3"],"app":"steemit/0.1"} |
created | 2018-03-10 06:30:48 |
last_update | 2018-03-10 06:30:48 |
depth | 1 |
children | 0 |
last_payout | 2018-03-17 06:30:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 524 |
author_reputation | -479,586,892,695 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 43,463,604 |
net_rshares | 0 |
To hear the speech version of this post click the play image. [](http://tts.giize.com/makerhacks__password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g.mp3) Brought to you by [@tts](https://steemit.com/tts/@tts/introduction). If you find it useful please consider upvote this reply.
author | tts |
---|---|
permlink | re-password-lesssshaccesstoyourlinuxmachineorraspberrypiusingpublickeys-g9zd17bv4g-20180303t004113 |
category | geek |
json_metadata | "" |
created | 2018-03-03 00:41:12 |
last_update | 2018-03-03 00:41:12 |
depth | 1 |
children | 0 |
last_payout | 2018-03-10 00:41:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 361 |
author_reputation | -4,535,154,553,995 |
root_title | "Password-Less SSH Access to Your Linux Machine or Raspberry Pi Using Public Keys" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 41,756,164 |
net_rshares | 0 |