I have tried to execute keytool from Java bin directory but I get an error with warning bash: keytool: command not found.
root@xxxxxx]# keytool -genkey -alias mypassword -keyalg RSA bash: keytools: command not found
The SolutionChange the directory and file access permission to allow you to access the file. If change access permission does not solve the problem, launch the Command Prompt as an administrator. Right click on Command Prompt and select “Run as administer”.
In order to run keytool from the command line, you need to add it to your system PATH. This step is required on Windows only, as keytool will is automatically installed on /usr/bin on macOS/Linux.
In the command prompt, invoke the keytool utility: (For Microsoft Windows) Type keytool.exe and press Enter. (For UNIX) Type keytool and press Enter. You can use the keytool utility from Oracle JDK Java 1.5 or 1.6.
These are the steps which solved my problem:
Search the path where my java was installed
find / -name jre
Move to java directory (where jre was installed on my server)
cd /path/to/jre/bin
Create SSL certificate with keytool command
./keytool -genkey -alias [mypassword] -keyalg [RSA]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With