Avatar of carlino70
carlino70Flag for Argentina

asked on 

Remove ssh key pair generated - Linux

Hi experts, I made a setup ssh key-pairs between two servers.
It worked well, but now I want to delete it.
The problem is that as it is now prompted for authentication locally to the application when trying to run a script for it. For example to run a stop_app, asks me to enter the user password ( should not ).
Here are the steps I did:
server_1:/home/user/> ssh-keygen -t rsa

Open in new window

I not joined the "passphrase" twice, then 2 files were generated:
id_dsa
id_dsa.pub

Open in new window

I copied id_dsa_pub to the server_2:
server_1:/home/user/scp id_rsa.pub user@server_2:/home/user/.ssh/

Open in new window

Prior backup, renamed it id_rsa.pub:
server_2:/home/user/cp -p authorized_keys authorized_keys_bkp
server_2:/home/user/mv id_rsa.pub authorized_keys

Open in new window

I grant permission to the new file:
server_2:/home/user/chmod 644 authorized_keys

Open in new window

To try to remove the entries, I tried on both servers:
ssh-keygen -R hostname

Open in new window

without positive results.
Then, when I returned to the previous file, "autorized_keys", I try:
server_1:/home/user/>ssh user@server_2:/home/user

Open in new window

I see the message:
ssh server_2:/home/user: Temporary failure in name resolution

Open in new window

I did not make a backup of known_hosts.
What are the correct steps to roll back the configuration?
Tkankyou in advanced, regards.
Linux

Avatar of undefined
Last Comment
carlino70
Avatar of gheist
gheist
Flag of Belgium image

It is a problem with DNS server or DNS records, nothing to do with authorized keys files.
Avatar of carlino70
carlino70
Flag of Argentina image

ASKER

I had to regenerate the keys, using a resident script in my /home, which updates the authorized_keys and known_hosts files. It is based on the list of users and network nodes.
This for all users.
With this I could solve the problem.
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of carlino70
carlino70
Flag of Argentina image

ASKER

Thanks!
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo