LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   scp: error while loading shared libraries: libcrypto.so.1 (https://www.linuxquestions.org/questions/slackware-14/scp-error-while-loading-shared-libraries-libcrypto-so-1-a-4175735688/)

mfoley 04-04-2024 09:52 PM

scp: error while loading shared libraries: libcrypto.so.1
 
I just did a slackpkg update/upgrade-all for 15.0. Something didn't work. When I attempt scp I get:
Code:

scp: error while loading shared libraries: libcrypto.so.1: cannot open shared object file: No such file or directory
Searching the web, I see suggestions that openssl needs to be installed, but slackpkg search shows I have openssl-1.1.1w-x86_64-1_slack15.0

Searching for libcrypto.so.1 on my computer gives:
Code:

# find / -name libcrypto.so\*

/usr/lib64/libcrypto.so
/usr/lib64/libcrypto.so.1.1
/lib64/libcrypto.so.1.1

How do I fix this?

kermitdafrog8 04-04-2024 10:09 PM

scp: error while loading shared libraries: libcrypto.so.1
 
My libcrypt.so.1 links to libcrypt1-2.39.so on current. Libcrypt.so.1 is in /lib64.

mfoley 04-05-2024 12:30 AM

Quote:

Originally Posted by kermitdafrog8 (Post 6494168)
My libcrypt.so.1 links to libcrypt1-2.39.so on current. Libcrypt.so.1 is in /lib64.

What are you suggesting? Manually linking? I guess I could do that, but doesn't seem right on a stable release. I do have /lib64/libcrypt.so.1 - but is that the same thing as libcrypto.so.1?

I'm tempted to revert back to the pre-update-all backup and try the update again. I've updated another system and don't have this problem.

Petri Kaukasoina 04-05-2024 12:38 AM

You have something old trying to link to libcrypto.so.1. It's not same as libcrypto.so.1.1. To find it, save the script below as, say, "finddep". Then run it as './finddep libcrypto.so.1$' The dollar sign is important at the end.
Code:

#!/bin/sh
[ $# -lt 1 ] && echo 'Usage, for example: ' $0 'libsoup-2.4.so.1' && exit 1
cd /var/adm/packages
for pkg in *; do
( cd /
  while read line; do
    [ "$line" = "FILE LIST:" ] && break
  done
  while read f; do
    [ -x "$f" -a -f "$f" -a -r "$f" ] && objdump -p "$f" 2>/dev/null|grep NEEDED|grep -Eq "$1" && echo "$pkg": /"$f"
  done
) < $pkg
done


henca 04-05-2024 12:50 AM

My guess is that it for some reason is your scp binary that links to the old libcrypto.so.1. Could it be that your scp binary is from Slackware 14.2?

The following commands might explain something:

Code:

ldd /usr/bin/scp
Code:

grep usr/bin/scp /var/log/packages/*
Code:

which scp
regards Henrik

mfoley 04-06-2024 12:22 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6494182)
You have something old trying to link to libcrypto.so.1. It's not same as libcrypto.so.1.1. To find it, save the script below as, say, "finddep". Then run it as './finddep libcrypto.so.1$' The dollar sign is important at the end.

Results of your 'finddep script:
Code:

# ./finddep  libcrypto.so.1$
libreoffice-6.0.6-x86_64-1alien: /usr/lib64/libreoffice/program/libpostgresql-sdbc-impllo.so
libreoffice-6.0.6-x86_64-1alien: /usr/lib64/libreoffice/program/libucpdav1.so
libreoffice-6.0.6-x86_64-1alien: /usr/lib64/libreoffice/program/python-core-3.5.5/lib/lib-dynload/_hashlib.cpython-3.5m.so
libreoffice-6.0.6-x86_64-1alien: /usr/lib64/libreoffice/program/python-core-3.5.5/lib/lib-dynload/_ssl.cpython-3.5m.so

This is interesting. libreoffice 6.0.6 is quite old, installed in 2018. The latest version (Alien Bob) is 7.6.4. I don't use LibreOffice on this computer. Perhaps if I uninstall it the problem will be fixed? Not sure how/why this would affect scp. I'll wait before removing this package for additional feedback -- in case I might mess something up!
Quote:

Originally Posted by henca (Post 6494185)
My guess is that it for some reason is your scp binary that links to the old libcrypto.so.1. Could it be that your scp binary is from Slackware 14.2?

The following commands might explain something:

Code:

ldd /usr/bin/scp
Code:

grep usr/bin/scp /var/log/packages/*
Code:

which scp
regards Henrik

Here are my results:
Code:

# ldd /usr/bin/scp
        linux-vdso.so.1 (0x00007ffc0f9d7000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fb6af917000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fb6af912000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fb6af8f8000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb6af719000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb6af995000)

# grep usr/bin/scp /var/log/packages/*
/var/log/packages/openssh-9.3p2-x86_64-1_slack15.0:usr/bin/scp
/var/log/packages/system-config-printer-1.5.15-x86_64-5:usr/bin/scp-dbus-service

# which scp
/usr/bin/scp

I think this looks OK, although no crypto libs are listed. Possibly the LibreOffice issue is the problem? But I don't see why that should affect scp. If I remove the LibreOffice package should I also reinstall openssh?

Petri Kaukasoina 04-06-2024 01:49 AM

Yes, everything looks fine.

You could removepkg libreoffice. It's so old that it won't probably work anyway because of other missing library dependencies. But I don't think it has any connection with the scp problem.

In 15.0, scp does not link to libcrypto itself but it runs ssh which links to libcrypto. Would you please try these:

Code:

$ ldd /usr/bin/ssh
        linux-vdso.so.1 (0x00007ffd17f12000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f55b3f56000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007f55b3f51000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f55b3f37000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f55b3ee5000)
        libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f55b3a00000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f55b3ecb000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f55b3cea000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f55b409a000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007f55b3929000)
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007f55b38fb000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f55b38f5000)
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007f55b38e6000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f55b38df000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f55b38be000)
$ objdump -p /usr/bin/ssh|grep NEEDED 
  NEEDED              libdl.so.2
  NEEDED              libutil.so.1
  NEEDED              libresolv.so.2
  NEEDED              libgssapi_krb5.so.2
  NEEDED              libcrypto.so.1.1
  NEEDED              libz.so.1
  NEEDED              libc.so.6

And another idea. Do you have any LD_ environment variables set? Try:
Code:

$ env|grep LD_
There shouldn't be any.

Petri Kaukasoina 04-06-2024 02:20 AM

Try this, too:
Code:

$ type scp
scp is /usr/bin/scp

('which' does not show aliases or functions.)

henca 04-06-2024 06:06 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6494390)
In 15.0, scp does not link to libcrypto itself but it runs ssh which links to libcrypto.

This might depend upon which openssh package you have installed in Slackware 15.0. On an old, outdated, reference installation of the original released Slackware 15.0 I get the following:

Code:

henca@munin:~> cat /etc/slackware-version
Slackware 15.0
henca@munin:~> ldd /usr/bin/scp
        linux-vdso.so.1 (0x00007ffef1b16000)
        libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f7cf3d6f000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f7cf3d6a000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007f7cf3d65000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f7cf3d4b000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f7cf3d11000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f7cf3cf7000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f7cf3b16000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7cf3af5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7cf40dc000)
henca@munin:~> ls /var/log/packages/openssh-8.8p1-x86_64-2
/var/log/packages/openssh-8.8p1-x86_64-2

Also, on a slightly more updated, but now still obsolete Slacwkare 14.2 system I get:

Code:

nazgul:~> cat /etc/slackware-version
Slackware 14.2
nazgul:~> ldd /usr/bin/scp
        linux-vdso.so.1 (0x00007ffd4f39b000)
        libcrypto.so.1 => /lib64/libcrypto.so.1 (0x00007f2ab61c8000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f2ab5fc4000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007f2ab5dc0000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f2ab5ba9000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f2ab5971000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f2ab5755000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f2ab538c000)
        /lib64/ld-linux-x86-64.so.2 (0x0000563e8908e000)
nazgul:~> ls /var/log/packages/openssh-7.4p1-x86_64-2_slack14.2
/var/log/packages/openssh-7.4p1-x86_64-2_slack14.2

The scp in Slackware 14.2 is dynamically linked to libcrypto.so.1.

One thing to debug what is going on here might be to study the output of:

Code:

strace -f scp
On my outdated reference installation of the original Slackware 15.0 I get among all those lines from strace:

Code:

openat(AT_FDCWD, "/lib64/libcrypto.so.1.1", O_RDONLY|O_CLOEXEC) = 3
and
Code:

openat(AT_FDCWD, "/lib64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
regards Henrik

mfoley 04-06-2024 11:56 AM

Wow! Lots of feedback! Thanks
Quote:

Originally Posted by Petri Kaukasoina (Post 6494390)
Yes, everything looks fine.

You could removepkg libreoffice. It's so old that it won't probably work anyway because of other missing library dependencies. But I don't think it has any connection with the scp problem.

Here's what I've got:
Code:

# ldd /usr/bin/ssh
        linux-vdso.so.1 (0x00007ffd0c99e000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fa852d87000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fa852d82000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fa852d68000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fa852d16000)
        libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fa852a31000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fa852a17000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fa852836000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa852ecb000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007fa85275f000)
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007fa852731000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fa85272b000)
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007fa85271c000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fa852715000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa8526f2000)

# objdump -p /usr/bin/ssh | grep NEEDED
  NEEDED              libdl.so.2
  NEEDED              libutil.so.1
  NEEDED              libresolv.so.2
  NEEDED              libgssapi_krb5.so.2
  NEEDED              libcrypto.so.1.1
  NEEDED              libz.so.1
  NEEDED              libc.so.6

No reference to libcrypto.so.1
Quote:

And another idea. Do you have any LD_ environment variables set? Try:
Code:

$ env|grep LD_
There shouldn't be any.
There isn't.
Quote:

Originally Posted by Petri Kaukasoina (Post 6494392)
Try this, too:
Code:

$ type scp
scp is /usr/bin/scp

('which' does not show aliases or functions.)

Code:

# type scp
scp is /usr/bin/scp

Quote:

Originally Posted by henca (Post 6494410)
This might depend upon which openssh package you have installed in Slackware 15.0. On an old, outdated, reference installation of the original released Slackware 15.0 I get the following:

Code:

henca@munin:~> cat /etc/slackware-version
Slackware 15.0

:
henca@munin:~> ls /var/log/packages/openssh-8.8p1-x86_64-2
/var/log/packages/openssh-8.8p1-x86_64-2[/CODE]

I get:
Code:

# cat /etc/slackware-version
Slackware 15.0

# slackpkg search openssh
[ installed ] - openssh-9.3p2-x86_64-1_slack15.0

Quote:

One thing to debug what is going on here might be to study the output of:

Code:

strace -f scp
On my outdated reference installation of the original Slackware 15.0 I get among all those lines from strace:

Code:

openat(AT_FDCWD, "/lib64/libcrypto.so.1.1", O_RDONLY|O_CLOEXEC) = 3
and
Code:

openat(AT_FDCWD, "/lib64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
regards Henrik
Hmmm, when I ran the strace and grep'ed for crypto I got nothing.

OK, I'm going to remove LibreOffice, possible reboot, and report back.

mfoley 04-06-2024 12:05 PM

Later ... Mystery solved. I removed the LibreOffice package and scp is back in action. How they were connected is unknown! Thanks all!


All times are GMT -5. The time now is 03:25 AM.