Questions tagged [known-hosts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

What is the host key (the one from ssh connection) and how is it different from public-private key pair?

The situation is that I've had a VPS created previously. It was all set up, private-public key authentication, root login turned off, password login turned off. Everything was set up. Then this server ...
michal roesler's user avatar
0 votes
1 answer
1k views

How to fix offending key phrase, that pops up again and again?

For a github repo I want to update it and I type git fetch --all on the command line, but I am always asked Warning: the ECDSA host key for 'xxx.yyy' differs from the key for the IP address '123.456....
Alex's user avatar
  • 115
10 votes
2 answers
18k views

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: ...
Clint Laskowski's user avatar
0 votes
1 answer
5k views

ssh-keyscan to known_hosts produces no results

When I execute: ssh-keyscan -H 172.22.56.2 I get the following output: # 172.22.56.2:22 SSH-2.0-RomSShell_4.31 # 172.22.56.2:22 SSH-2.0-RomSShell_4.31 # 172.22.56.2:22 SSH-2.0-RomSShell_4.31 # 172.22....
A L's user avatar
  • 137
2 votes
1 answer
2k views

Can I set SSH known_hosts to ignore a specific hostname?

I've set up a few headless Raspberry Pi systems using a Raspbian system image lately. They default to using the zeroconf domain name raspberrypi.local. Before I can change it, I have to connect to the ...
Robert's user avatar
  • 117
2 votes
0 answers
372 views

Remove BOTH ssh key for IP and ssh key for FQDN from known_hosts

Is it possible to remove an ssh key from known_hosts both for the IP and for the FQDN of a machine, knowing only one of the 2? For example, I am on machine A, and I want to remove the public ssh key ...
Michele Piccolini's user avatar
0 votes
1 answer
29 views

known hosts deleted / login fails

I deleted the known_host entries on a 1&1 Virtual Server. I once had changed the original root pwd for the server. With the new pwd as of right now, I can't login any more. The 1&1 support guy ...
Frank's user avatar
  • 1
0 votes
0 answers
4k views

ECDSA host fingerprint changes if the host is already known

I'm using a web hosting service that offers both FTP and SSH access, but for SSH they only allow authentication via SSH keys. I've generated myself SSH keys using ssh-keygen, imported them into my ...
Aaron Franke's user avatar
2 votes
2 answers
317 views

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! @\r", "@@@...
shalom's user avatar
  • 501
0 votes
1 answer
357 views

SSH host key check fails on Debian version, but not on MacOS version

I have this strange situation with host-key checking. ssh -v github.com: works with "OpenSSH_7.9p1, LibreSSL 2.7.3" on MacOS Mojave (10.14.5 (18F132)): debug1: Server host key: ssh-rsa SHA256:...
Dominik's user avatar
  • 317
0 votes
2 answers
2k views

ssh-keyscan does not read .ssh/config?

I am using ssh-keyscan in a shell script to accept keys for hosts. The hosts are identified by hostname but not in /etc/hosts. They are in ./ssh/config so I can ssh <hostname> but I can not ...
stone.212's user avatar
  • 327
0 votes
2 answers
4k views

known_host for SSH connection

I program an application in Java. This application make a connection between two PC (One Windows and One Linux). My application must make a connection and make few commands. Among commands, I want ...
Tom Laratte's user avatar
1 vote
3 answers
3k views

How to automatically delete the key line from known_hosts when a session is closed?

I'm working on automating a whole environment by using AWS CloudFormation and during the testing period I'm required to kill and re-create the servers very often. The servers are configured to set ...
Itai Ganot's user avatar
  • 10.8k
12 votes
5 answers
22k views

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 ...
Foo Barberger's user avatar
4 votes
2 answers
5k views

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 ...
Ilmanowar's user avatar
1 vote
1 answer
335 views

Upgrade path for HostKeyAlgorithms

I'd like to change the default setting for HostKeyAlgorithms for all SSH connections to prefer ssh-ed25519 over ecdsa-sha2-nistp256. But I currently have ecdsa-sha2-nistp256 host keys for many hosts ...
Feuermurmel's user avatar
-1 votes
1 answer
272 views

ubuntu // running an ssh command as a specific user

I'm looking to add github to known_hosts for the deploy user when the command is ran by the root user. The command would be : ssh -T -o "StrictHostKeyChecking no" [email protected] Using cloudinit, it ...
Ben's user avatar
  • 113
2 votes
1 answer
1k views

OpenSSH adds <IPv6>%2 to known_hosts

When I connect to a CentOS 7 host with IPv6 my ssh client always adds <IPv6 host addr>%2 to known_hosts even though the host key for this host (with the host's IPv6 address) is already present ...
Felix Schwarz's user avatar
1 vote
0 answers
3k views

Warning: Remote host identification has changed (SSH)

Most likely someone did a server update last night, because when I try to do a rsync (from win 7) I get the message (short version): WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! It is possible ...
Steven's user avatar
  • 275
1 vote
1 answer
6k views

How to save ssh-keyscan result with the port to .ssh/known_hosts

When I run ssh-keyscan -p NNN -t rsa GITHOST it produces sting like GITHOST ssh-rsa ...
kmmbvnr's user avatar
  • 111
4 votes
2 answers
3k views

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 ...
Randy L's user avatar
  • 147
38 votes
2 answers
4k views

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 ...
Matt Korostoff's user avatar
1 vote
1 answer
2k views

Adding address to known_hosts command line

I am having trouble adding an IP to known_hosts from command line. I have a mysql backup script that is supposed to upload files to an other server using sftp. The script works fine, but you have to ...
Firze's user avatar
  • 355
4 votes
2 answers
22k views

Add remote host to known_hosts file without prompt [duplicate]

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" [email protected] which will add the remote ...
VenomFangs's user avatar
45 votes
9 answers
116k views

Auto accept rsa key fingerprint from command line

I've tried yes | ssh [email protected] 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's user avatar
2 votes
1 answer
2k views

Stop Jenkins from modifying known_hosts

I have a Jenkins installation in CentOS 6 where the known hosts file, /var/lib/jenkins/.ssh/known_hosts, is under configuration management. It contains, for instance, a key to a source control host ...
Ed I's user avatar
  • 143
0 votes
1 answer
12k views

Cant find "known_hosts" file

one short and probably stupid thing is annoying me... I can't find my 'known_hosts' file on my Windows Server 2008 but it must exist. On the server I have a git-repository that others can access and ...
Steini's user avatar
  • 105
6 votes
3 answers
574 views

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 ...
Dan Nestor's user avatar
-2 votes
1 answer
3k views

~/.ssh/known_hosts file - how to set it up? [duplicate]

I'm trying to SCP a file from my server to another server. The command I'm using is: scp -i private.ppk -P 22 foo.txt [email protected]:/home/someuser/foo.txt When I run this via the command line, ...
snoopy76's user avatar
  • 103
2 votes
1 answer
2k views

Duplicate entries are added to known_hosts file on every login

I have .ssh/config file in this format: Host ABC Hostname example.com HostKeyAlias ABC CheckHostIP yes StrictHostKeyChecking no Port 1001 User userABC Host CDE Hostname example.com HostKeyAlias CDE ...
Serge's user avatar
  • 21
2 votes
1 answer
3k views

Known Hosts ECDSA Host Key Multiple Domains on One IP

Hello, world!, I have a VPS set up with multiple domain names pointing to it. Arbitrarily, I like to access it via SSH through the domain name I'm dealing with. So for example, if I'm doing ...
Jonah's user avatar
  • 169
1 vote
1 answer
3k views

SSH known_hosts holds duplicate keys for same server

I notice my local ~/.ssh/known_hosts file has two entries for the same machine on the local LAN: somemachine,192.168.1.200 ssh-rsa KEY... somemachine.search.domain ssh-rsa KEY... It's the same key,...
xref's user avatar
  • 273
97 votes
2 answers
160k views

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's user avatar
  • 2,086
2 votes
1 answer
110 views

Configure a host to be a known one for SSH for all users

Context: Modern Ubuntu server. We have a certain host that should be known to all users on all machines. This is to avoid interactive prompt on first connect to it (which fails in non-interactive ...
Alexander Gladysh's user avatar
3 votes
2 answers
2k views

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 [email protected] it does tell ...
Gergely's user avatar
  • 33
0 votes
6 answers
312 views

Sed regexp /d deleting whole file

Given a typical known_hosts file: [123.45.67.89]:22 ssh-rsa bbuivvhbkbjdnflksndkfnksnfk... [98.76.54.32]:14444 ssh-rsa hohdibsodbfoasbfbsabdfbsd... [77.34.122.33]:32209 ssh-rsa ...
Cor's user avatar
  • 15
0 votes
1 answer
3k views

CentOS5 & OpenSSH not recognizing 'HashKnownHosts' and 'StrictHostKeyChecking' directives in sshd_config

I am running the latest build of OpenSSH (4.3p2) from CentOS 5. When I attempt to start the server with /etc/init.d/sshd start, this is the output from bash: Starting sshd: /etc/ssh/sshd_config: ...
Rob's user avatar
  • 261
0 votes
2 answers
4k views

Passwordless ssh from Windows to Linux to run scripts from command prompt

What am trying here is ..... I Have some scripts that needs to run in Windows Command (command.exe) and not from Cygwin. The scripts needs to access a specific Linux machine from Windows command ...
user avatar
38 votes
7 answers
22k views

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's user avatar
2 votes
4 answers
2k views

How can I keep SSH's know_hosts up to date (semi-securely)?

Just to get this out in front so I am not told not to do this: The machines in question are all on a local network with little to no internet access (they aren't even well connected to the corporate ...
Chas. Owens's user avatar
  • 2,083
10 votes
4 answers
28k views

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 ...
Prody's user avatar
  • 623
343 votes
27 answers
555k views

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 ...
gareth_bowles's user avatar
3 votes
2 answers
5k views

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 ...
sid__'s user avatar
  • 309
1 vote
3 answers
2k views

Generating SSHFP record from OpenSSH known_hosts file entry

I have an entry from an OpenSSH known_hosts file; I'd like to generate an SSHFP resource record for this. I can use ssh-keygen to generate the fingerprint with no difficulty: $ ssh-keygen -f ...
cjs's user avatar
  • 1,405