SSH user directory gets wierdly updated on every connection to remote places
by AsgAnquietas from LinuxQuestions.org on (#6CWB7)
Hello,
I have a rather strange issue going on with one of my freshly installed Linux Desktop machines.
I am running Kubuntu 22.04.2 LTS (Desktop with KDE) and I want to SSH into a Server running in my office.
I have the regular ".ssh" directory in my Homedir (~administrator/.ssh) which already contains my "id_rsa", "id_rsa.pub", "known_hosts" files.
The problem is that everytime I ssh into another box (regardless of which server I ssh into), that local ".ssh" directory gets somehow updated and screws up my Rsync.
Code:administrator@instructor-pc [~] $ date
Tue Jul 11 03:25:57 PM EEST 2023
administrator@instructor-pc [~] $ ls -al |grep ssh
drwx------ 2 administrator users 4096 Jul 11 15:21 .ssh
administrator@instructor-pc [~] $ ssh adam@SERVER
(SSH Key is already added to "known_hosts", so no confirmation needed here)
Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-210-generic i686)
[...]
adam@SERVER [~] $ exit
logout
Connection to SERVER closed.
administrator@instructor-pc [~] $ ls -al |grep ssh
drwx------ 2 administrator users 4096 Jul 11 15:26 .ssh
administrator@instructor-pc [~] $ date
Tue Jul 11 03:26:50 PM EEST 2023
administrator@instructor-pc [~] $But no file gets modified in that repective directory:
Code:administrator@instructor-pc [~] $ ls -al .ssh/
total 28
drwx------ 2 administrator users 4096 Jul 11 15:26 .
drwx------ 23 administrator users 4096 Jul 11 15:17 ..
-rw-r--r-- 1 administrator users 574 Jul 10 12:13 authorized_keys
-rw------- 1 administrator users 2614 Jul 8 12:47 id_rsa
-rw-r--r-- 1 administrator users 584 ian 27 2020 id_rsa.pub
-rw------- 1 administrator users 364 Jul 11 15:05 known_hosts
-rw-r--r-- 1 administrator users 142 Jul 11 15:05 known_hosts.old
administrator@instructor-pc [~] $ date
Tue Jul 11 03:29:01 PM EEST 2023
administrator@instructor-pc [~] $I think something is happening with the ".ssh" directory (as in modifications!) while I ssh into the remote linux box.
Something updates the directory but leaves no trace at all...
The problem is that I use Rsync software to Rsync via SFTP/SSH to another Server and everytime I rsync, after the rsync of the important stuff is performed, the rsync always leaves the ".ssh" directory to be resynced because of this directory modification... (I check with another rsync to ensure that there are no leftovers).
I need my script files to rsync perfectly, so that in the next verification rsync, there are no leftovers to be rsynced.
If I issue:
Code:ssh -vvv adam@SERVER, it gives me, near the end of the log, the following:
Code:debug1: client_global_hostkeys_private_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding
debug3: hostkeys_foreach: reading file "/home/administrator/.ssh/known_hosts"
debug3: host_delete: ED25519 key already at /home/administrator/.ssh/known_hosts:1
debug3: host_delete: ECDSA key already at /home/administrator/.ssh/known_hosts:2
debug1: update_known_hosts: known hosts file /home/administrator/.ssh/known_hosts2 does not existFirst,
1. I don't have a "known_hosts2" file.
2. The hostkey of the remote server is already added to my known_hosts file. If it weren't, it would prompt me to save the key, which is not the case.
3. Yeah, and another wierd thing, it generates an "known_hosts.old" file, I don't know why... it is a simple addition of a new server...
If anyone had a similar problem and found a fix... I would appreciate a hint :-)
Thank you.
I have a rather strange issue going on with one of my freshly installed Linux Desktop machines.
I am running Kubuntu 22.04.2 LTS (Desktop with KDE) and I want to SSH into a Server running in my office.
I have the regular ".ssh" directory in my Homedir (~administrator/.ssh) which already contains my "id_rsa", "id_rsa.pub", "known_hosts" files.
The problem is that everytime I ssh into another box (regardless of which server I ssh into), that local ".ssh" directory gets somehow updated and screws up my Rsync.
Code:administrator@instructor-pc [~] $ date
Tue Jul 11 03:25:57 PM EEST 2023
administrator@instructor-pc [~] $ ls -al |grep ssh
drwx------ 2 administrator users 4096 Jul 11 15:21 .ssh
administrator@instructor-pc [~] $ ssh adam@SERVER
(SSH Key is already added to "known_hosts", so no confirmation needed here)
Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-210-generic i686)
[...]
adam@SERVER [~] $ exit
logout
Connection to SERVER closed.
administrator@instructor-pc [~] $ ls -al |grep ssh
drwx------ 2 administrator users 4096 Jul 11 15:26 .ssh
administrator@instructor-pc [~] $ date
Tue Jul 11 03:26:50 PM EEST 2023
administrator@instructor-pc [~] $But no file gets modified in that repective directory:
Code:administrator@instructor-pc [~] $ ls -al .ssh/
total 28
drwx------ 2 administrator users 4096 Jul 11 15:26 .
drwx------ 23 administrator users 4096 Jul 11 15:17 ..
-rw-r--r-- 1 administrator users 574 Jul 10 12:13 authorized_keys
-rw------- 1 administrator users 2614 Jul 8 12:47 id_rsa
-rw-r--r-- 1 administrator users 584 ian 27 2020 id_rsa.pub
-rw------- 1 administrator users 364 Jul 11 15:05 known_hosts
-rw-r--r-- 1 administrator users 142 Jul 11 15:05 known_hosts.old
administrator@instructor-pc [~] $ date
Tue Jul 11 03:29:01 PM EEST 2023
administrator@instructor-pc [~] $I think something is happening with the ".ssh" directory (as in modifications!) while I ssh into the remote linux box.
Something updates the directory but leaves no trace at all...
The problem is that I use Rsync software to Rsync via SFTP/SSH to another Server and everytime I rsync, after the rsync of the important stuff is performed, the rsync always leaves the ".ssh" directory to be resynced because of this directory modification... (I check with another rsync to ensure that there are no leftovers).
I need my script files to rsync perfectly, so that in the next verification rsync, there are no leftovers to be rsynced.
If I issue:
Code:ssh -vvv adam@SERVER, it gives me, near the end of the log, the following:
Code:debug1: client_global_hostkeys_private_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding
debug3: hostkeys_foreach: reading file "/home/administrator/.ssh/known_hosts"
debug3: host_delete: ED25519 key already at /home/administrator/.ssh/known_hosts:1
debug3: host_delete: ECDSA key already at /home/administrator/.ssh/known_hosts:2
debug1: update_known_hosts: known hosts file /home/administrator/.ssh/known_hosts2 does not existFirst,
1. I don't have a "known_hosts2" file.
2. The hostkey of the remote server is already added to my known_hosts file. If it weren't, it would prompt me to save the key, which is not the case.
3. Yeah, and another wierd thing, it generates an "known_hosts.old" file, I don't know why... it is a simple addition of a new server...
If anyone had a similar problem and found a fix... I would appreciate a hint :-)
Thank you.