• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“530 Non-anonymous sessions must use encryption” – while using curl

By admin

The Problem

“Non-anonymous sessions must use encryption” occurs when running curl command as root user:

# curl -v -k --ftp-ssl --ftp-pasv ftp://192.168.X.X:990/ --user hcpa:XXX
* About to connect() to 192.168.X.X port 990 (#0)
* Trying 192.168.X.X... connected
* Connected to 192.168.X.X (192.168.X.X) port 990 (#0)
< 220 FTP SERVER INFOVALMER.
> USER hcpa
< 530 Non-anonymous sessions must use encryption.
* Access denied: 530
* Closing connection #0
curl: (67) Access denied: 530

However it's working when running the same curl command as non-root user:

# exit
logout
# su - testuser
$ curl -v -k --ftp-ssl --ftp-pasv ftp://192.168.X.X:990/ --user hcpa:XXX
* About to connect() to 192.168.10.1 port 990 (#0)
* Trying 192.168.X.X... connected
* Connected to 192.168.X.X (192.168.X.X) port 990 (#0)
< 220 FTP SERVER INFOVALMER.
> AUTH SSL
< 234 Proceed with negotiation.
* Initializing NSS with certpath: /etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* NSS: client certificate not found (nickname not specified)
* SSL connection using SSL_RSA_WITH_3DES_EDE_CBC_SHA
* Server certificate:
* subject: ,CN=ftp-infovalmer,OU=VALORADOR,O=INFOVALMER,L=BOGOTA,ST=CUNDINAMARCA,C=CO
* start date: sep 10 22:11:55 2015 GMT
* expire date: sep 09 22:11:55 2018 GMT
* common name: ftp-infovalmer
* issuer: @ ,CN=ftp-infovalmer,OU=VALORADOR,O=INFOVALMER,L=BOGOTA,ST=CUNDINAMARCA,C=CO
> USER hcpa
< 331 Please specify the password.
> PASS XXX
< 230 Login successful.

The Solution

Add $LD_LIBRARY_PATH enviroment variable in /root/.bash_profile.

/usr/bin/curl looks for the directory /apps/MATLAB/v81/bin/glnxa64/ when searching for library libcurl.so.4:

# ldd /usr/bin/curl
linux-vdso.so.1 => (0x00007fffc9f7d000)
libcurl.so.4 => /apps/MATLAB/v81/bin/glnxa64/libcurl.so.4 (0x00007f291de7b000) <-----
libidn.so.11 => /lib64/libidn.so.11 (0x0000003201600000)
libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00000033afc00000)
librt.so.1 => /lib64/librt.so.1 (0x00000033ab400000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00000032bba00000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00000032bc200000)

Under normal circumstance, /usr/bin/curl is supposed to look for the directory /usr/lib64/ when searching for library libcurl.so.4:

# ldd /usr/bin/curl
linux-vdso.so.1 => (0x00007fff8dbe1000)
libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00000033ac400000) <-----
libidn.so.11 => /lib64/libidn.so.11 (0x0000003201600000)
libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00000033afc00000)
librt.so.1 => /lib64/librt.so.1 (0x00000033ab400000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00000032bba00000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00000032bc200000)

1. Adding $LD_LIBRARY_PATH enviroment variable in /root/.bash_profile will impact all applications running as root user, so remove LD_LIBRARY_PATH in /root/.bash_profile first;

2. Then specify the run-time search path when compiling matlab application, please consult with application vendor matlab and check if there is any way to achieve this.

Or
Set LD_LIBRARY_PATH when executing program, for example:

# LD_LIBRARY_PATH= ./app_test

"LD_LIBRARY_PATH=[PATH]b" only takes effect when running the above command, it will not impact other applications.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to enable IPv6 on CentOS / RHEL 6
  2. CentOS / RHEL : How to determine which SNMP version is being used
  3. How to Automate Startup/Shutdown of Oracle Database and Listener on Linux
  4. Understanding iscsiadm Utility in CentOS / RHEL
  5. CentOS / RHEL : How to find the creation time of LVM volume
  6. Examples of creating command alias in different shells
  7. How To Identify User Deleting Files From A Given Directory in Linux
  8. How To Create/Remove and Mount a Stratis Filesystem in CentOS/RHEL 8
  9. Unable to set a GRUB password on a Raspberry Pi 3 system
  10. How To Check a Disk for Bad Blocks or Disk Errors on CentOS / RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • SQL script to find tables that are fragmented
  • TRUNCATE TABLE not releasing space from tablespace
  • How to reclaim entire space of an oracle database table with “Truncate Table” statement
  • Oracle SQL Script to Report Tablespace Free and Fragmentation
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary