Тёмный

Windows Terminal SSH Public Key Authentication 

William Campbell
Подписаться 7 тыс.
Просмотров 28 тыс.
50% 1

How to setup a public/private key pair in Windows Terminal for secure shell.
Also see related videos:
Install and configure Windows Terminal: • Windows Terminal Insta...
Windows SSH Server Public Key Authentication: • SSH To Windows Using P...
Commands to copy and paste:
-------------------
Linux:
-------------------
mkdir .ssh
chmod 700 .ssh
chmod 700 authorized_keys
rm id_rsa.pub
sudo nano /etc/ssh/sshd_config
sudo systemctl restart ssh
-------------------
Windows:
-------------------
ssh-keygen -b 4096
( update below with your [user folder], [user], and [host] )
scp C:\Users\[user folder]\.ssh\id_rsa.pub [user]@[host]:~/.ssh

Наука

Опубликовано:

 

7 мар 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 74   
@kencharles7048
@kencharles7048 2 года назад
I couldn't find anything close to how good this explanation is. Many Thanks to you.
@wc7
@wc7 2 года назад
Very nice. Thank you.
@mpuertac
@mpuertac Год назад
Your explanation was unbeatable. Very helpful and clear.
@wc7
@wc7 Год назад
Thank you! I appreciate your positive feedback. Keeps me making more.
@jasperlouage
@jasperlouage 2 года назад
Nice work, really clear explanation and worked right away!
@wc7
@wc7 2 года назад
Great! Thank you.
@gerahardochoa6018
@gerahardochoa6018 2 года назад
Thanks for your clear explanation, everyone assumes that we have the ssh directory in our linux computer, but it's not
@wc7
@wc7 2 года назад
The directory '.ssh' is created in the user's home directory (or /root, for root user) when using SSH for the first time. At a minimum, the directory contains the file 'known_hosts", created on first attempt to connect to another machine using SSH. Note that '.ssh' is a hidden directory (it begins with a period), so it doesn't appear normally when using directory list command unless adding the 'show all files' switch, -a. If for any reason you need the directory before using SSH for the first time, simply create it. From the user (or root) directory, enter command mkdir .ssh
@currydude7
@currydude7 2 года назад
I was about to pull my hair out because I couldn't figure it out why my key wasn't working from windows to linux and I wasn't able to understand what was going wrong. I still don't, but this allows me to be more secure as I figure it out. Can't believe the lack of a simple ssh-copy-id function in windows gave me this much of a headache. Anyway thank you so much for this tutorial Mr. Campbell! Much appreciated. Enjoy your coffee
@wc7
@wc7 2 года назад
I hope you get it figured out. Post any questions that come up, and I'll try to help.
@daveporter4667
@daveporter4667 3 года назад
Great informative video. Thank you SIR!
@wc7
@wc7 3 года назад
You're welcome, and thanks for watching. I hope it helps. I have more admin related videos coming soon.
@daveporter4667
@daveporter4667 3 года назад
@@wc7 It does. I just started to learn and play with ubuntu. Thank you!
@ericzarahn9343
@ericzarahn9343 Год назад
These were superb instructions sir. Thank you.
@wc7
@wc7 Год назад
Thank you. I'm glad you liked it.
@brunolugarezi4078
@brunolugarezi4078 2 года назад
You're a legend! Thank you very much!
@wc7
@wc7 2 года назад
Very kind of you to say. Thank you.
@aliwalizada5221
@aliwalizada5221 2 года назад
This is just a saviour, thank you so much
@wc7
@wc7 2 года назад
You're very welcome!
@gastonlagaffe9156
@gastonlagaffe9156 Год назад
Great work!!! Thank you. Subed.👍
@wc7
@wc7 Год назад
Very kind of you. Thanks for watching. Suggestions for other topics are always welcome.
@musicalbirds2928
@musicalbirds2928 Год назад
Great video. Thanks for sharing.
@wc7
@wc7 Год назад
Thank you.
@aglerfamily
@aglerfamily 2 года назад
Thank you so very much! Our family wants to setup our own Minecraft server on an old pc. I know zip about Ubuntu, nada about what the heck I'm doing and even less on how to do it, but that's not stopping me! Your video helped me check off one of my many to-dos! One question: do you recommend setting up the Root password or leave it disabled? The server I'm setting up will (eventually) be accessed remotely by my eldest and I just want to ensure the pc/server is secure. Videos on creating secure connections will be greatly appreciated!! 🤓
@wc7
@wc7 2 года назад
The general advice is never to use root in normal situations. But I do in certain cases only because it's more convenient for me, like for accessing Webmin and PhpMyAdmin. However, I do this ONLY for a server physically in my office that the ports (which I've changed to obscure) for these services are strictly on my local network and are blocked from Internet access. For a public facing server, do not use the root user for any services open to the Internet. Certainly do not use root for SSH on a public server. Make another user in the sudo group so it can do what you need. And make sure there is a strong firewall between the server and Internet. I use pfSense (free), using pfBlocker, and running on old HP dc5800 hardware (under $100) with additional network card. Does Gig speed just great (other solutions like small fanless "firewall" appliances do not). Also use non-standard port numbers when possible. Not always possible, for example a mail server can't use other than port 25 or you'll never get mail. But many services can be changed to obscure port numbers, say 12476 (just an example). I do similar with my IMAP port and block the normal port number in the firewall. This cuts down on a vast amount of intruders knocking at the door. I'm not familiar with ports for Minecraft servers, but if the users who will access are a private group that you can tell them a different port number, and set that at your server, that blocks out everyone else, unless the intruders are lucky enough to guess the port number you've chosen. Odds are slim of that. Those are just a few steps to help security. Avoiding root is always a good choice.
@aglerfamily
@aglerfamily 2 года назад
@@wc7 thank you again! Please keep posting vids 🤓
@dughall_
@dughall_ 2 года назад
That was greatly explained and really helpful, thank you!
@wc7
@wc7 2 года назад
You're welcome. And thanks for the positive feedback. I appreciate it.
@hangemhi001
@hangemhi001 2 года назад
thank you from a linux newbie
@wc7
@wc7 2 года назад
You're welcome. I'm glad it helps.
@SlugLamer
@SlugLamer Год назад
So how exactly do you let the command know which key to use when trying to connect? imagine you have a whole range of different keys in your user\.ssh folder on windoze - somehow you gotta inform the command which key to use, right? I am using git bash and puttygen generated keys (.ppk files) and I can't get this to work. yet.
@wc7
@wc7 Год назад
The "i" option. Have you searched the web? Try "ssh specify private key to use". Here is one example result. There are many. superuser.com/questions/772660/howto-force-ssh-to-use-a-specific-private-key
@ethanweatherhead4087
@ethanweatherhead4087 2 года назад
what about if i use a yubikey to store the private key, how could i direct that so every time i want to ssh, i just plug it in
@wc7
@wc7 2 года назад
I have no idea what a "yubikey" is. So I don't know the answer.
@onurbamaro
@onurbamaro Год назад
Thank you!
@wc7
@wc7 Год назад
You're welcome!
@placeholder_name321
@placeholder_name321 3 года назад
Is this the same as installing SSH KEys from GIt Bash, or is this an entirely different process? I know nothing yet I'm sorry still learning
@wc7
@wc7 3 года назад
I don't know for sure, because I don't use Git Bash, but it looks similar. However, because it creates a key file of a different name, I suspect each method produces a different result, and each method should co-exist without messing up the other. It's possible you could use the Git Bash key file in place of "id_rsa.pub," as I explain in the video. Both are in the .ssh folder. But I haven't tested this, so please be careful if trying it.
@user-nu9bg3ul7u
@user-nu9bg3ul7u 2 года назад
at the 8:36, where does the "william:william" come from? I can't find what is mine
@wc7
@wc7 2 года назад
Look up "chown command" for specifics of change ownership command. In my case "william:william" is the user name and group name on the Linux system. When logged in to the Linux system, it is typical that you land in your home directory. List with switches -al as directed in the video, and the user name and group name is included in the list. Just as you see in the video, when I'm entering the chown and chmod commands, the list above has a column for user, and after it a column for group. In my case, both william, my user name, and my group name. List your home directory, and you'll see your values for user name and group name.
@user-nu9bg3ul7u
@user-nu9bg3ul7u 2 года назад
@@wc7 Thank you so much for help!
@nerdus8388
@nerdus8388 Год назад
helpful!
@wc7
@wc7 Год назад
Thanks
@PipolaPlayer1
@PipolaPlayer1 2 года назад
ssh: connect to host port 22: Connection refused
@wc7
@wc7 2 года назад
The host you're trying to connect to either doesn't have SSH server running, or a firewall is blocking port 22.
@iro0t626
@iro0t626 2 года назад
Thank you for your video. This is what I was looking for. I have a doubt, if I already have the keys generated with PUTTY, how can I use them with cmd or windows terminal? Thank you for your attention.
@wc7
@wc7 2 года назад
It's been a while since I used PUTTY. I assume it works similar. Files "id_rsa" and "id_rsa_pub" are created when a key is generated. The question is where does PUTTY store the files? If the standard default location, the folder //.ssh then follow the steps in the video except for key generation. Skip that step because keys already exist. If PUTTY stores the keys in a different folder, either copy them to .ssh or adjust the commands used to point to the folder where the public key ("id_rsa.pub") is stored.
@iro0t626
@iro0t626 2 года назад
@@wc7 Thank you for your answer. Yes, that's what I thought. But no.It does not work, it does not allow to establish the connection because the public key does not match. Any idea. Thanks again.
@wc7
@wc7 2 года назад
@@iro0t626 I don't know. You may have to generate a new key. There must be a difference in how PUTTY stores keys.
@rldel99
@rldel99 2 года назад
PuTTY stores keys generated by its own PuTTYgen program tn the drectory specified by the user in the save (or generate or export) dialog. PuTTY saves its keys as *.ppk files. It gives the option of loading and then exporting (Conversions tab) an existing .ppk key as an openSSH compatible private key, as well as presenting the corresponding public key in a window that can be copied and pasted into an openSSH authorized_keys file on a desired host. It's a little bit of work, but you can navigate from PuTTY into openSSH without being forced to create yet another key pair (to maintain). I don't know why there is a difference between the formats and when those differences might be merged and made transparent to us users.
@wc7
@wc7 2 года назад
@@rldel99 Thank you for the explanation. It's been a while for me since using PuTTY, and back that long ago when I did, it was without any key files. So I didn't really know the answer, but suspected something like you've described. Good to know now. Thank you.
@XanderManiaci
@XanderManiaci 2 месяца назад
followed all the steps but it still prompts me for my password :/
@wc7
@wc7 2 месяца назад
From afar I can't really help. Perhaps try it again, all steps. I don't know what else to do.
@bearr9835
@bearr9835 Год назад
👍
@wc7
@wc7 Год назад
Thanks
@cocichan8323
@cocichan8323 3 года назад
I can do this with bitcoin and ethereum ?
@wc7
@wc7 3 года назад
The video is about Windows Terminal connecting to SSH servers.
@wc7
@wc7 3 года назад
@Brian Campbell The steps in the video relate to SSH (Secure Shell). The technology involved is shared with others that use cryptographic keys. The primary tool is "openssl" command to generate keys. But what to do with the keys is a completely different subject. Understand that "openssl" is the thing to know about (SSL=Secure Sockets Layer, the encryption used in HTTPS; "open" simply means it's not proprietary). Do a Google search for "openssl key generation for cyptocurrency". This will point you in the right direction.
@rcdabral7494
@rcdabral7494 Год назад
Hi Campbell, I hope you doing well
@wc7
@wc7 Год назад
I am well. Keeping busy that's for sure. Thanks.
@rcdabral7494
@rcdabral7494 Год назад
Dear Campbell is there any greping in InDesign remove any specific xml tag with any attribute e.g. different types of values as tag attributes
@rcdabral7494
@rcdabral7494 Год назад
@@wc7 Nice😊
@wc7
@wc7 Год назад
@@rcdabral7494 The subject isn't relevant to SSH and Windows Terminal. Better to ask in comments for a video about InDesign and GREP: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-D_79JuIeu9k.html Regardless, the answer is I don't have a script that does find/replace on XML inside InDesign docs. It can be done, I just haven't yet. Haven't had a need. Would it help to update InDesign text after XML is imported? My GREP script could do that. Again, continue this conversation where the topic is relevant: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-D_79JuIeu9k.html
@rcdabral7494
@rcdabral7494 Год назад
@@wc7 sorry my apology
@psd4582
@psd4582 2 года назад
Please upload vice versa..
@wc7
@wc7 2 года назад
I don't understand what you mean. Could you elaborate?
@psd4582
@psd4582 2 года назад
Please upload ssh passwordless from linux to Windows.. From linux how can we ssh windows server, without password?
@wc7
@wc7 2 года назад
@@psd4582 OK, I understand. I will add to my list of videos to make. I've looked into it. Not much different except for one command. Do the same process just reverse Windows and Linux hosts, but at Windows instead of "cat id_rsa.pub >> authorized_keys" use "type id_rsa.pub > authorized_keys". Not sure yet where the Windows configuration for SSH is located but I'll study more and get it figured out for the video. Might be a while, I have a few videos ahead of it still.
@psd4582
@psd4582 2 года назад
Thanks william, in my organization, there is one passwordless requirement.. We have configured all the things but still passwordless authentication is not working.. It would be helpful if you upload video on it.. Thanks
@wc7
@wc7 2 года назад
Had a typo in my last reply. Should be "type id_rsa.pub >> authorized_keys". Two right angle brackets, not one. One will replace file. Two to append. However, there is more to it besides, now that I've tried it in action today. I have it just about figured out and will make a video as soon as possible.
Далее
OpenSSH for Absolute Beginners
23:00
Просмотров 102 тыс.
SSH Key Authentication | How to Create SSH Key Pairs
18:46
SSH To Windows Using Public Key
13:40
Просмотров 72 тыс.
My Top Tips for using Windows Terminal like a Pro
16:10
SSH Keys
10:12
Просмотров 105 тыс.
5 Must Have Tweaks to Secure OpenSSH
21:48
Просмотров 27 тыс.
How to use SSH Public Key authentication
8:26
Просмотров 121 тыс.
Haunt a Computer Using SSH [Tutorial]
19:10
Просмотров 389 тыс.
$1 vs $100,000 Slow Motion Camera!
0:44
Просмотров 26 млн
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41