Questions tagged [known-hosts]

43 questions
319
votes
24 answers

Can I automatically add a new host to known_hosts?

Here's my situation: I'm setting up a test harness that will, from a central client, launch a number of virtual machine instances and then execute commands on them via ssh. The virtual machines will have previously unused hostnames and IP…
gareth_bowles
  • 8,867
  • 9
  • 33
  • 42
88
votes
2 answers

scp without known_hosts check

Is there any chance to skip the known_hosts check without clearing known_hosts or disable it in ssh.conf? I neither have access to known_hosts nor ssh.conf yet. Don't find any suitable in man.
burnersk
  • 1,966
  • 4
  • 25
  • 38
36
votes
2 answers

Is there a security risk to disclosing your SSH known_hosts file?

I'm speaking at a conference next week about some software tools I've created. My laptop will be shown on a projector screen during this presentation. The presentation will be videotaped and posted on youtube. If, for some reason, I have occasion…
Matt Korostoff
  • 475
  • 4
  • 7
36
votes
8 answers

SSH into a box with a frequently changed IP

I have some cloud boxes that change their IP frequently. I ssh using the hostname but have to edit the known_hosts file every time the server launches because of this error message: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ …
coneybeare
  • 611
  • 1
  • 7
  • 14
27
votes
8 answers

Auto accept rsa key fingerprint from command line

I've tried yes | ssh root@10.x.x.x to try to accept the RSA key fingerprint, but am still prompted if I'm sure I want to connect. Is there a way to make this automatic?
VenomFangs
  • 529
  • 2
  • 6
  • 10
10
votes
4 answers

How to make ssh match known_hosts to host/ip:port instead of just host/ip?

I have two machines behind a firewall, with the ssh ports forwarded to 2201 and 2202. When I ssh host -p 2201 it asks if I trust the machine, I say yes, it gets added to ~/.ssh/known_hosts Then I ssh host -p 2202 It doesn't let me, because…
Prody
  • 603
  • 3
  • 7
  • 16
9
votes
4 answers

Public Key Authentication Windows Port of OpenSSH

I have been attempting to get Public Key Authentication working with the PowerShell port of OpenSSH onto a VM running Windows Server 2012 R2. I have faithfuly followed the installation instructions and have assured that my file permissions are…
Foo Barberger
  • 91
  • 1
  • 1
  • 5
6
votes
3 answers

Same IP on many systems in different environments

I work in an environment where there are multiple locations, and in each locations we have the same IP addressing scheme, that is, we have many machines (one in each location) that share the same IP address (the hostnames are different though).…
Dan Nestor
  • 220
  • 1
  • 2
  • 7
4
votes
2 answers

Does Terraform Deal with “known_hosts” upon changing infrastructure? If so, how?

I'm very new to terraform so maybe this is not a great question. But I'm running through [this Amazon EC2 example] and at one point it tries to SSH to the machine, I assume to install nginx. This is always bombing out for me, and I just see repeated…
Randy L
  • 147
  • 1
  • 8
4
votes
2 answers

Add remote host to known_hosts file without prompt

I wrote some scripts and wish to add a remote host to my known_hosts file without any interaction. I can run a command like ssh -o "StrictHostKeyChecking no" root@10.x.x.x which will add the remote host key to my known hosts, but it will be followed…
VenomFangs
  • 529
  • 2
  • 6
  • 10
3
votes
2 answers

SSH known_hosts with a dynamic IP

I have a machine behind a firewall. I connect to it remotely using a VPN tunneling with a port forward through ssh. To connect to the machine I use the external IP of the VPN and my personal and temporary assigned port. The command I use is: ssh…
Ilmanowar
  • 41
  • 1
  • 5
3
votes
2 answers

Wiped out the known_hosts file on my server machine. Is it safe?

I am fairly new to managing my production server and I had some problems accessing my EC2 account with the RSA HOst key for xxx has changed message. I read on a couple of Blogs that by simply deleting the known_hosts in the /root/.ssh/ folder the…
sid__
  • 299
  • 2
  • 4
  • 7
3
votes
2 answers

Why does SSH think I still have a 'known_hosts2' file?

While trying to clean up my SSH config and key files on my iMac (macOS Monterey 12.1), I tried to SSH using the verbose flag (-v). This generated output including the following lines: ... debug1: load_hostkeys: fopen /Users/clint/.ssh/known_hosts2:…
2
votes
2 answers

how to create status of REMOTE HOST IDENTIFICATION HAS CHANGED when performing ssh to remote machine for testing

We want to cause the status from a remote Linux machine to return "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r", "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! …
shalom
  • 451
  • 12
  • 26
2
votes
1 answer

OpenSSH adds %2 to known_hosts

When I connect to a CentOS 7 host with IPv6 my ssh client always adds %2 to known_hosts even though the host key for this host (with the host's IPv6 address) is already present in known_hosts. What does the %2 stand for? I'm using…
Felix Schwarz
  • 203
  • 2
  • 11
1
2 3