Questions tagged [known-hosts]

45 questions
357
votes
28 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…
105
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
  • 2,186
55
votes
10 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?
41
votes
7 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: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ …
39
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…
15
votes
5 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…
13
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:…
11
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
  • 633
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).…
5
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…
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
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…
3
votes
2 answers

I want non-interactive first ssh access

I would like to access my new virtual server in the cloud with ssh from an install script so that it does not ask for user interaction. When I use plain ssh -i keys.pem user@host.com it does tell me that this is a new host, do I trust it? As I…
Gergely
  • 33
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__
  • 309
  • 2
  • 4
  • 7
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
  • 521
1
2 3