Outils pour utilisateurs

Outils du site


blog

Pb ssh - no matching key exchange method found

$ ssh root@192.168.10.22 -p22
Unable to negotiate with 192.168.10.22 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

$ ssh root@192.168.10.22 -p22 -oKexAlgorithms=diffie-hellman-group1-sha1
Unable to negotiate with 192.168.10.22 port 22: no matching cipher found. Their offer: 3des-cbc

Solution

Ajouter les arguments :

  • -oKexAlgorithms=diffie-hellman-group1-sha1
  • -c 3des-cbc (voir plus haut)
ssh root@192.168.10.22 -p22 -oKexAlgorithms=diffie-hellman-group1-sha1 -c 3des-cbc

Ou

$ ssh root@192.168.188.196
Unable to negotiate with 91.121.188.196 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

Solution

ssh -o HostKeyAlgorithms=+ssh-dss root@192.168.188.196

Autres

ssh -Q cipher

2025/03/24 15:06

Pb smtp 451 internal resource temporarily

$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
3C15E419BB    94582 Thu Oct  1 17:45:14  jean@acme.fr
(host eu-smtp-inbound-1.mimecast.com[195.130.217.211] said: 451 Internal resource temporarily unavailable - http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#451 (in reply to RCPT TO command))
                                         CharlesHenry.DeLaRocheFoucault@HackMe.com

Solution :

Attendre !

Sinon, pour annuler l'envoi (Effacer le mail)

postsuper -d 3C15E419BB

Au début j'ai crus à un pb de majuscule : Bref tr A-Z a-z quoi. Puis j'ai pensé que ça pouvait venir du champ REPLY TO Il n'en est rien

2025/03/24 15:06

Pb SIGSEGV workrave

Même pb que https://bugs.archlinux.org/task/46621

$ workrave
Erreur de segmentation

$ echo $?
139

On peut faire un strace pour en savoir un peu plus

2025/03/24 15:06

Pb segfault - stack trace

Debugging Segfaults - (ProFTPd exemple)

If you see a message like the following in your logs:

golem.castaglia.org (127.0.0.1[127.0.0.1]) - ProFTPD terminating (signal 11)

then you have most likely encountered a segfault. This is a particular bad error, and can be hard to track down.

In version 1.3.1rc1, ProFTPD gained the ability to provide better logging to help track down these sorts of bugs. To enable this ability, you will need to configure proftpd with something like:

$ ./configure --enable-devel=stacktrace ...

and run your proftpd like normal. If a segfault occurs, the logs should show something like this:

golem.castaglia.org (127.0.0.1[127.0.0.1]) - ProFTPD terminating (signal 11)
golem.castaglia.org (127.0.0.1[127.0.0.1]) - FTP session closed.
golem.castaglia.org (127.0.0.1[127.0.0.1]) - -----BEGIN STACK TRACE-----
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [0] ./proftpd [0x809b1e1]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [1] ./proftpd(call_module+0x53) [0x8072c63]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [2] ./proftpd(strftime+0x14cf) [0x8051bef]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [3] ./proftpd(pr_cmd_dispatch+0x167) [0x8051f2f]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [4] ./proftpd(strftime+0x1fd3) [0x80526f3]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [5] ./proftpd [0x8053e12]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [6] ./proftpd [0x805484d]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [7] ./proftpd [0x8057975]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [8] ./proftpd(main+0x9d1) [0x8058625]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [9] /lib/i686/libc.so.6(__libc_start_main+0x93) [0x40076507]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - [10] ./proftpd(strcpy+0x31) [0x8051001]
golem.castaglia.org (127.0.0.1[127.0.0.1]) - -----END STACK TRACE-----

These stack symbols are generated automatically by glibc, and may or may not contain the function names.

The key here for tracking down the location of the segfault is that [0] frame, and the memory address: 0x809b1e1. Using that address and a very handy command called addr2line, you can determine the location of that address in the source code:

$ addr2line -e ./proftpd 0x809b1e1

In this example, I saw:

$ addr2line -e ./proftpd 0x809b1e1
/home/tj/proftpd/cvs/proftpd/modules/mod_auth.c:1723

which is the location of test code added to trigger the segfault.

This feature is specific to glibc systems, so keep that in mind. Other things to mention about this feature: it disables the changing of the process title that proftpd normally does. The obtaining of the stack symbols that glibc does uses the process title, and if this feature did not disable that process title changing, the output would be much less legible. Also, it does not work if the process which receives the SIGSEGV signal is chrooted. (Blame glibc for its bad handling of being chrooted.) To work around this, I would recommend using the mod_vroot module, just for a short period of time, in order to get a useful automatic stack trace.

2025/03/24 15:06

Pb rsync

protocol version mismatch

http://ss64.com/bash/rsync.html

# rsync -axP acme:/var/www/ ~/backup/www
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(176) [Receiver=3.1.1]
ssh acme /bin/true > out.dat

Le fichier out.dat doit être vide. Si ce n'est pas le cas

Exemple :

J'ai dû modifié mon .bashrc (de Acme) comme suit : .bashrc

bin/start.sh

.bashrc

if [ $TERM == 'xterm' ]
then
        bin/start.sh
fi

A tester : --no-motd

Err - No space left on device - but work if remove

Voir :

find ./app?/L*/log/ -type f  -print0 | rsync -e \"ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -p 22 -i /home/app_a/.ssh/id_l_sync_hst1 \"  --bwlimit="5000" -c --itemize-changes --files-from=- --from0 "/home/app_a" "l_sync_hst1"@"192.168.1.44":"/home/l_sync_hst1/data/"
cd+++++++ app1/
cd+++++++ app1/L12/
cd+++++++ app1/L12/log/
<f+++++++ app1/L12/log/plop.csv
<f+++++++ app1/L12/log/out.0
<fcsT.... app1/L12/log/out.0
rsync: [receiver] write failed on "/home/l_sync_hst1/data/app1/L12/log/out.0": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(379) [receiver=3.2.5]
rsync: connection unexpectedly closed (29554 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [sender=2.6.8]

Mais fonctionne si

sftp -o IdentityFile=/home/pcc/.ssh/id_l_sync_hst1 id_l_sync_hst1@192.168.1.10 <<EOF
rm data/app1/L12/log/out.0
EOF
Solution

Ajouter --inplace

find ./app?/L*/log/ -type f  -print0 | rsync -e \"ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -p 22 -i /home/app_a/.ssh/id_l_sync_hst1 \"  --bwlimit="5000" -c --inplace --itemize-changes --files-from=- --from0 "/home/app_a" "l_sync_hst1"@"192.168.1.10":"/home/l_sync_hst1/data/"
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki