Add options for SSH

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.