LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old Yesterday, 12:29 AM   #16
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,215

Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104

Quote:
Originally Posted by ttpp View Post
Thanks. I don't want to edit it. I wanted to look at it as I thought someone said that it contained IP addresses, so I am curious to see what the file looks like.

"sudo more .ssh/host_rsa_key" or "sudo more .ssh/host_rsa" ----- I'll try them.

Tried it in terminal, didn't work.
According to your last post, the name of the file is ssh_host_dsa_key.text — or, if that was just a copy, ssh_host_dsa_key

Last edited by scasey; Yesterday at 01:24 AM.
 
Old Yesterday, 01:22 AM   #17
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 672

Rep: Reputation: 317Reputation: 317Reputation: 317Reputation: 317
Quote:
Originally Posted by ttpp View Post
"sudo more .ssh/host_rsa_key" or "sudo more .ssh/host_rsa" ----- I'll try them.

Tried it in terminal, didn't work.
You can just use cat, they're not all that long.
That said, the "private" key just is a stream of seemingly random characters between the -----BEGIN and -----END lines, there is no user meaningful info there.
The public key is a bit more informational as it's meant to be shared:
it starts with the cipher (ssh-rsa, ssh-dsa or so), then the actual key and at the end the user@host of the system it's supposed to be used against.
 
1 members found this post helpful.
Old Yesterday, 07:25 AM   #18
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,945

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
Originally Posted by ttpp View Post
Thanks. I'm trying to open, in terminal, the file: "ssh_host_dsa_key" using "sudo xdg-open ssh_host_dsa_key" and keep getting ""Unable to detect the URI-scheme of "ssh_host_dsa_key""

My guess is that it needs a file extension.....?

Thx.
Linux does not, in general, use file extensions. Ever, really, except for certain things it needs the sysadm to pick out at a glance (like .conf). Some programs recognize certain file extensions, but they are really only used by humans to recognize file types. People very familiar with the Linux way use the 'file' command to determine a file type, but even that is not needed here. The file type is TEXT and it is human readable. The command line
Code:
cat ssh_host_dsa_key
will dump it to the terminal so that you can read it.

Last edited by wpeckham; Yesterday at 07:28 AM.
 
Old Today, 05:13 AM   #19
ttpp
LQ Newbie
 
Registered: Jul 2019
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Linux does not, in general, use file extensions. Ever, really, except for certain things it needs the sysadm to pick out at a glance (like .conf). Some programs recognize certain file extensions, but they are really only used by humans to recognize file types. People very familiar with the Linux way use the 'file' command to determine a file type, but even that is not needed here. The file type is TEXT and it is human readable. The command line
Code:
cat ssh_host_dsa_key
will dump it to the terminal so that you can read it.
Thank you. Is there an article or something you could point me to for creating new (4) host files? I think I was told that one or all of the host files are used to identify my computer on the web, regardless, I know that someone said that with the private host keys that they could launch MITM attacks.

Since someone may have been on my computer when I was in root, I would like to replace them with new host files. If not all of the host files can be used to identify me on the web, private host files, please let me know as there may not be a good reason to replace them. Thanks.

Last edited by ttpp; Today at 05:48 AM.
 
Old Today, 07:10 AM   #20
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,945

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
Originally Posted by ttpp View Post
Thank you. Is there an article or something you could point me to for creating new (4) host files? I think I was told that one or all of the host files are used to identify my computer on the web, regardless, I know that someone said that with the private host keys that they could launch MITM attacks.

Since someone may have been on my computer when I was in root, I would like to replace them with new host files. If not all of the host files can be used to identify me on the web, private host files, please let me know as there may not be a good reason to replace them. Thanks.
Well, host files do not identify the person, only the host machine originating the connection. That said, if you want to understand using, creating, and identifying the files I would start with the info or man pages for sshd (and, to some extent, ssh).

While not intended to be instructive, the documentation provided by the maintainers as info or man pages is almost always a good place to look first. Answering such questions about the product and using it is why those pages are built and maintained. If they do not answer all of your questions, they do provide you with enough information to prompt your search terms for google, duckduckgo, or other search engines to find tutorials or other online discussion of the topics of interest to you.

Last edited by wpeckham; Today at 07:13 AM.
 
Old Today, 07:20 AM   #21
ttpp
LQ Newbie
 
Registered: Jul 2019
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Well, host files do not identify the person, only the host machine originating the connection. That said, if you want to understand using, creating, and identifying the files I would start with the info or man pages for sshd (and, to some extent, ssh).

While not intended to be instructive, the documentation provided by the maintainers as info or man pages is almost always a good place to look first. Answering such questions about the product and using it is why those pages are built and maintained. If they do not answer all of your questions, they do provide you with enough information to prompt your search terms for google, duckduckgo, or other search engines to find tutorials or other online discussion of the topics of interest to you.
Thanks. I'll give the man pages a look.
 
Old Today, 09:36 AM   #22
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,623

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by ttpp View Post
Thanks. I don't want to edit it. I wanted to look at it as I thought someone said that it contained IP addresses, so I am curious to see what the file looks like.

"sudo more .ssh/host_rsa_key" or "sudo more .ssh/host_rsa" ----- I'll try them.

Tried it in terminal, didn't work.
It would not be in them files anyways, they only contain the key where you will find an ip if it puts it there is in the known_hosts file. On my Debian system it does not put them in there on my Mac it does put the IP associated with the login.

Code:
MacUser2525:~$ haswell
Linux haswell 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u3 (2019-06-16) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jul 10 22:50:30 2019 from 192.168.0.3
seeder1@haswell:~$ cat .ssh/known_hosts 
|1|fE4QtF7r64JOdqo6iTKctlpZ7+I=|o2ZnrFx0aW3mA/a4oEh58BeUKbE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAWqgf65MjC7kXwbvAR7kzg1CJjLVg2IF7j5IIOi6bZHP6pe2zKzwM6df//d6Gdl8uwni2ZMFn7MLp+J6ED8hDA=
|1|i0NhLgqxOE7wlqiYLpD41zOXi5w=|8OEKCuV2ZiapE9z/U6SIdnnO7F4= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM6OpjR8XZfsY+Woc1tT/tPhmx7PaqucFXVAE+njccOvh4J9VUz0JUFOCj+5zwdmzxMqJ9dh+dWUCq+ghLYDFUw=
From my Mac.

Code:
MacUser2525:~$ cat .ssh/known_hosts 
192.168.0.102 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvDHkR0b4mcFhdH0On/vlJmoDnyiij4IGcPzlr5pto9AhG+9vRTI1iZHKfrMmGGD78Ws0y2AGGEJ0BX4Qq3DbuKeOL1m2Afh4p6EpPQ1ZX7f/NiV5ZfYHM8tHJn+SDExEAG4h5LYaV0QA/LK/c9kv2hTmUukwbhrnkW/6GuP6WNzh61dY/TCsyaCd2z4+j20XHvCjdUgAghoOC3m1KlVnkhnTK9HC6A1oI8DNP40BB2ba/Ens1iPFfcYXSPMaPxE5xEVblWU9JHRVvJThFPS/N5w6Y8nk6GQitH3BaXCgyczyiysQUw0Y/FVU6gdCAruH59+qGZa7FH94nMyRaIN/p
192.168.0.106 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCVuzZcsg2pcsh1/kO+tKP5IsFgUcHs9wmnDhyv1U9KUACmPWEzH8tiNs1ulUMroHyWOVpINfXYxg49CWmsnNwTAAlvEUW7gRYVxgmkGaP3N3iVVGblco24sEZKmwLOZXU6CHhqkzyhNC3d5O0pkbtISumk3x4z9+/GhCx7FjxgwMQ4JTjPmkAkaiPUcjjHHm+slC69gKRsYps75WiSstRJzaRJ/yMkWkOo03duIDy2ANNftMr7op+dD6xNhYVHrlPYgQZ1LsLGJyc0kyVxmzBE24SToJ0qCjj0XkuueqN8HOmv+5nmzgh3d/EqpC9qWfyn3fKBFbtJqU7ph0XzG4Dn
Oh and if you use the proper name for the file in terminal then it shows you no problem the contents of the file no sudo is needed you as the user who generated the file have all the permissions necessary to do anything you wish with it..

Code:
seeder1@haswell:~$ more .ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA6j7GTSXaSXUGRtO/4yRAh7WVGBWyFOwH+UJNXGodpG+OM3VU
M3XaSCZfCcuP/WiokrJ/dr04p1D2BPl2EzU9c030mMBid23bkBWk6HkT9fRibxW0
ntvmviVmWc6R2vqDITr0SfW1vmla51Tp2ZDV9/n+SnilLkQhesWU9Bdn5p7Cc2yf
im3ESgRAcYT0pnsVoC/E5/W+SmyI2iYOa/fRFcnccfx4KiTLjZJWtB2dE+lyuHVq
7mDiajSdnxu5aVkAxEIf2eoyByQJ4KN92Wj5z2litwJtBwx1w9ozsRc8UyK5CQGr
mjarOOTbDynpQmdi/vwuu6Byd3SGWUxneXS/AQIBIwKCAQEAtLQVUXT42ZTKU+Ut
oJhPCZq02BC8k8wGJq99gc40H8PFeCdPlWmLIbczX1PkG0IbpF3QCyRBpaTbCybX
bec+CH33NAIgEvz51Y0KL63cMsPW5/rNKhdaOummuk7li6tPNuRWDStDDztUwRWe

[snip ...]

seeder1@haswell:~$ ls -l .ssh/
total 16
-rw-r--r-- 1 seeder1 seeder1 1203 Apr 27  2018 authorized_keys
-rw------- 1 seeder1 seeder1 1675 Apr 27  2018 id_rsa
-rw-r--r-- 1 seeder1 seeder1  381 Apr 27  2018 id_rsa.pub
-rw-r--r-- 1 seeder1 seeder1  444 Jul  8 21:24 known_hosts
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SSH - How can I only allow a key pair login for my user account not root account? shanekelly Linux - Security 5 01-25-2013 09:45 AM
SSH Public/Private key pair wh33t Linux - Security 4 10-10-2012 04:09 PM
Howto automount an encrypted partition over ssh using key pair authentication DutchNyko Linux - Security 2 11-05-2011 02:26 AM
ssh Key pair whoes Red Squirrel Linux - Security 2 08-17-2008 08:12 PM
DISCUSSION: Forward ports via an SSH tunnel with auto reconnect (using key pair authentication) merize147 LinuxAnswers Discussion 0 07-24-2006 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration