LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-25-2014, 06:45 AM   #1
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Rep: Reputation: Disabled
bash:openssl:command not found error on generating ssl certificate on postfix centos


Hello,

I configured by postfix server with sasl for smtp auth and since wihtout tls it isn't secure,i want to create ssl certificate.

I did the following as per one document:
mkdir /etc/postfic/ssl
cd /etc/postfix/ssl

if /usr/bin/openssl exists:
mv /usr/bin/openssl /usr/bin/openssl_orig

ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl(i did this though there is no /usr/local/ssl)
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

and on running the last command it said:
Code:
bash: openssl: command not found
openssl and openssl-devel are installed. So whats could be the issue?
 
Old 07-25-2014, 07:13 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
From the error message it says command not found which means it is not able to find the binary. As you said that openssl and openssl-devel package is already install then it appears to be search path issue. Try the following:

1. Try to find openssl binary using
Code:
find / -name openssl
Once you get the location of openssl binary, then check your PATH variable using:

2.
Code:
echo $PATH
check if it contains the path where you found openssl binary. Incase you are unable to find openssl binary from step 1 itself then the files are missing and you should better re-install the package.
 
Old 07-25-2014, 07:22 AM   #3
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
on running the first command i got the following:
Code:
find / -name openssl
/etc/pki/ca-trust/extracted/openssl
/usr/lib64/openssl
/usr/include/openssl
/usr/bin/openssl
on running the 2nd command from /etc/postfix/ssl/ i got the following:
Code:
 echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/sarah/bin
What is possibly wrong and what should i do now?
 
Old 07-25-2014, 07:26 AM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
I can see from the output you pasted that /usr/bin is in the path and binary also exist. What happens if you try to execute the command as follows:

Code:
/usr/bin/openssl
 
Old 07-25-2014, 07:31 AM   #5
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
Well on running that way from /etc/postfix/ssl(usr/bin/openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024 from /etc/postfix/ssl) it says the following:

Code:
bash: /usr/bin/openssl: No such file or directory
 
Old 07-25-2014, 07:34 AM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
I am not sure which document you referred but you renamed your original openssl to openssl_orig and then created a soft link. Why you need to do that? YOu also mention that location does not exist still you created softlink. Revert the changes that you have done and it will work fine. Share the document which you are referring as I a not sure why they suggested to do it that way.
 
Old 07-25-2014, 07:38 AM   #7
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
hello,

i have the doucment in only printed form so i do not have the location to share..

Now how do i revert the changes?
 
Old 07-25-2014, 07:47 AM   #8
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
Thank you...That worked..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSL Library Error: -8181 Certificate has expired in centos webserver SarahGurung Linux - Newbie 5 09-24-2012 12:32 PM
[SOLVED] Centos 5 Error :- -bash: yum: command not found sachinsud Linux - Server 56 06-21-2012 07:41 PM
Generating a Self Signed SSL Certificate carlosinfl Linux - Server 2 07-22-2009 03:39 PM
openssl ssl error code 14090086 verify the CA cert is ok / certificate verify failed acummings Slackware 14 02-27-2009 01:51 AM
Can I retrieve certificate expiry date from an openssl certificate (command line) davee Linux - Security 1 07-21-2006 10:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration