Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Deleted known_hosts file on private server, how do I get it back? Post 303035039 by stomp on Sunday 12th of May 2019 06:20:32 AM
Old 05-12-2019
Hi,

Quote:
Deleted known_hosts file on private server, how do I get it back?
The obvious answer is: Restore it from your backup. If you do not have one, or realize that your backup does not allow restoration, that may be a serious problem.

The file known_hosts does not really have to do with authentication. You may use ssh-keyscan to gather the keys from different hosts, or just initiate an ssh command to that host, like RudiC said. You may temporarily ignore the host-keys with an ssh command like this:

Code:
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ...

Authentication is described within the OpenSSH manpages. See here for details:

OpenSSH: Manual Pages

Check especially the AUTHENTICATION and FILES sections in ssh(1) command there for general descriptions and required file permissions. As reading this there, I would advise that all "recommended file settings" there are strictly done that way. I'm not sure that this wouldn't cause errors if not done so.

Last edited by stomp; 05-12-2019 at 07:31 AM..
 

9 More Discussions You Might Find Interesting

1. IP Networking

Able to ping server's private network

Hi guys, I'm in the progress of setting up a private network in our Sun solaris platform. Existing ip: 172.16.102.101 New private ip: 192.168.2.3 Netmask is the same for both private & public 255.255.255.0 After setting up the ip, I'm able to ping this private ip address from our... (3 Replies)
Discussion started by: *Jess*
3 Replies

2. UNIX for Dummies Questions & Answers

Restoring back a deleted file in unix.

Hi, Can any one tell me how to restore back the deleted file in unix? I know the file name. If i know the inode number of the file does help more to restore back the file? (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

3. Linux

Bring back a deleted partition

I deleted my partition on a test server and want to bring back the partition. I have not rebooted yet, so system is operational. I have the /proc/partition major minor #blocks name 8 0 195359960 sda 8 1 1044224 sda1 8 ... (2 Replies)
Discussion started by: photon
2 Replies

4. Solaris

ssh private keys stored on home server

Where in the world are the ssh private keys stored on the home server? I know the public keys are renamed to authorized_keys under the /export/home//.ssh directory on the remote server. (1 Reply)
Discussion started by: jastanle84
1 Replies

5. UNIX for Dummies Questions & Answers

Solaris and known_hosts

Hello, I have a file known_hosts where i want to remove a key, but i don't how to do remove a client on it ? Can you help me please ? Thanks very much (1 Reply)
Discussion started by: jose2204
1 Replies

6. UNIX for Dummies Questions & Answers

Deleted /etc/passwd file while accessing to our test server via putty

Hi I was accessing our linux test server via putty and By mistake i deleted /etc/passwd file..... It is allowing me to login..... So could anyone please help me out in this issue.... Please, it is urgent (6 Replies)
Discussion started by: rahul547
6 Replies

7. UNIX for Advanced & Expert Users

How to check or remove IP address from a hashed known_hosts file?which

Hi, In my server, the hostname and IP addresses are added to the known_hosts which then be hashed by ssh-keygen -H -f. Is it possible to check if an IP address has already been added to the hashed known_hosts to avoid duplications (I think there will be problems if there are duplicated IP... (3 Replies)
Discussion started by: hce
3 Replies

8. Shell Programming and Scripting

Files not deleted in source server

I have connected to the source server by ftp command. when I tried to delete the file I am getting the permission error. delete file1.txt 450 No permission to delete /today1/file1.txt the files have below permission 150 File status okay; about to open data connection. drwx------ 0 ... (3 Replies)
Discussion started by: ramkumar15
3 Replies

9. Linux

Recover deleted files on Linux server

Hi Guys, Greetings!. I have executed the cronjob that runs the shell script which is in directory.When the cronjob was executed , I found that the directory where the script resides has got deleted. Note: The directory was deleted with other use not root user. The... (9 Replies)
Discussion started by: reminisce
9 Replies
ssh-keysign(1M) 														   ssh-keysign(1M)

NAME
ssh-keysign - ssh helper program for host-based authentication SYNOPSIS
ssh-keysign ssh-keysign is used by ssh(1) to access the local host keys and generate the digital signature required during host-based authentication with SSH protocol version 2. This signature is of data that includes, among other items, the name of the client host and the name of the client user. ssh-keysign is disabled by default and can be enabled only in the global client configuration file /etc/ssh/ssh_config by setting Host- basedAuthentication to yes. ssh-keysign is not intended to be invoked by the user, but from ssh. See ssh(1) and sshd(1M) for more information about host-based authen- tication. /etc/ssh/ssh_config Controls whether ssh-keysign is enabled. /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_rsa_key These files contain the private parts of the host keys used to generate the digital signature. They should be owned by root, readable only by root, and not accessible to others. Because they are readable only by root, ssh-keysign must be set-uid root if host-based authentication is used. ssh-keysign will not sign host-based authentication data under the following conditions: o If the HostbasedAuthentication client configuration parameter is not set to yes in /etc/ssh/ssh_config. This setting cannot be overri- den in users' ~/.ssh/ssh_config files. o If the client hostname and username in /etc/ssh/ssh_config do not match the canonical hostname of the client where ssh-keysign is invoked and the name of the user invoking ssh-keysign. In spite of ssh-keysign's restrictions on the contents of the host-based authentication data, there remains the ability of users to use it as an avenue for obtaining the client's private host keys. For this reason host-based authentication is turned off by default. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsshu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ ssh(1), sshd(1M), ssh_config(4), attributes(5) AUTHORS
Markus Friedl, markus@openbsd.org HISTORY
ssh-keysign first appeared in Ox 3.2. 9 Jun 2004 ssh-keysign(1M)
All times are GMT -4. The time now is 03:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy