When using SSH, you can see that SSH has many functions, what is-O,-e and so on. Such as
requirements, you want to add a parameter to the SSH function. For example, my current requirement is that when I execute SSH, I can add an option, give me a tag for each SSH operation, and every time I grep the tag I can find the SSH process exactly.
Then we need to find the source of SSH.
SOURCE http://www.openssh.com/portable.html
On the left, select the appropriate OS platform, and here's Linux as an example, after entering the Linux page
Select a mirror location and click Download
Download unzip to find this file of ssh.h, edit
Find the Help code block for SSH add a custom code of-Z
When you find the following function code block, add the parameters you want to add in the while and I've added "Z" here.
Then add a case at the end of the block (a bit similar to the case in the shell, and then add the functionality)
My function here is to print the tag I typed, which is the Optarg-Z parameter, and I'll print it out. It is printf, and finally don't forget to add a break;
Then you can put it on a Linux server and install it.
Compilation method
Find Configure Add executable permission
[[email protected] openssh-7.3p1]# cd/opt/src/openssh-7.3p1/[[email protected] openssh-7.3p1]# chmod +x Configure perform compilation [ [Email protected] openssh-7.3p1]#./configure--prefix=/opt/svr/opensslprefix: Where to install after compiling
The final display is that the compilation is successful and you can install the
* If there is any dependent library in the compilation that needs to be installed, then Yum installs it.
Then install it without error.
Make && make install
The following error may occur
and re-install
Verify:
[Email protected] openssl]# Cd/opt/svr/openssl/[[email protected] openssl]#./bin/ssh-h
Can see one of the parameters we added
This adds a parameter
Add options for SSH