Add John the Ripper to System PATH
In this step, you will add the directory containing the john executable to your system's PATH environment variable. This will allow you to run john from any location in the terminal without having to type the full path.
The john executable is currently located at ~/project/john-1.9.0-jumbo-1/run. To make it globally accessible for your user, you need to add this path to your shell's configuration file. Since the lab environment uses Zsh, the file is ~/.zshrc.
Use the echo command to append the export command to your ~/.zshrc file.
echo 'export PATH="$HOME/project/john-1.9.0-jumbo-1/run:$PATH"' >> ~/.zshrc
This command adds the run directory to the beginning of your PATH. The change will only take effect in new terminal sessions. To apply it to your current session, you need to "source" the configuration file.
source ~/.zshrc
Now, let's verify that it works. First, move out of the run directory to your home directory.
cd ~
From your home directory, try running john without specifying the path.
john
If the PATH was set correctly, you will see the same usage information as before. This confirms that you can now run John the Ripper from anywhere.
John the Ripper 1.9.0-jumbo-1 [linux-gnu 64-bit x86_64 AVX2 AC]
Copyright (c) 1996-2019 by Solar Designer and others
Homepage: https://www.openwall.com/john/
Usage: john [OPTIONS] [PASSWORD-FILES]
...