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.