How to integrate openSSH and SCRT-Linux Enterprise Application-Linux server application information is as follows. OpenSSH/openSSL is currently the most popular open-source software, protecting millions of Linux, BSD, and Unix hosts. The commercial SSH server/Client has never supported openSSH/openSSL very well. In windows, the Client SecureCRT must support openSSH in one way or another.
Either, use the public key/key generated by SecureCRT (SCRT for short) and place the public key on the openSSH Server. SCRT can use the certificate to log on to the openSSH server, however, if you log on to the openSSH server from another machine that uses the openSSH client, you will not be able to log on to the server.
Alternatively, if you use the public key/key generated by openSSH, the machine that installs the openSSH client will be connected, but SCRT will not be able to communicate.
I have been pondering this issue for a long time. Later, in the official SecureCRT Forum, someone mentioned that SecureCRT has supported openSSH keys since 4.0. So with a try, I upgraded SCRT to 4.1 and re-configured it!
The openSSH server + SCRT/openSSH Client combination is implemented. In the future, both the win platform and the * nix platform can easily use certificates to log on. This solves a major problem.
How to implement?
The following describes how to configure and implement it.
Configure openSSH server
The content of/etc/ssh/sshd_config is as follows:
Port 22 Protocol 2 HostKey/etc/ssh/secure KeyRegenerationInterval 1 h SyslogFacility AUTHPRIV LoginGraceTime 5 m PermitRootLogin yes PubkeyAuthentication yes AuthorizedKeysFile. ssh/authorized_keys IgnoreRhosts yes HostbasedAuthentication no PasswordAuthentication yes PermitEmptyPasswords no ChallengeResponseAuthentication no Subsystem sftp/usr/libexec/openssh/sftp-server
This configuration allows you to log on with a certificate or password. This configuration is useful when you are on a business trip to other places without a certificate. If you want to only use the certificate, you will:
PasswordAuthentication yes
Changed:
PasswordAuthentication no
Use ssh-keygen to generate public key/Key
For example, to generate the public key/Key of the user hzqbbc, first su to the user of hzqbbc, and then enter:
Ssh-keygen-t dsa
Ssh-keygen will prompt the file storage location and key encryption word, as required. The following is an example:
[Hzqbbc @ p4. ssh] $ ssh-keygen-t dsa Generating public/private dsa key pair. enter file in which to save the key (/home/hzqbbc /. ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in/home/hzqbbc /. ssh/id_dsa. your public key has been saved in/home/hzqbbc /. ssh/id_dsa.pub. the key fingerprint is: aa: 0a: 3c: be: 7f: 35: 9b: 4f: 82: bf: 1d: ca: 0b: dc: bc: cc hzqbbc @ p4
Copy id_dsa and id_dsa.pub to windows
Create the C: \ SSH directory on the windows client, and copy id_dsa and id_dsa.pub to C: \ SSH. Ensure that the file name is id_dsa and id_dsa.pub.
Configure SCRT
Please confirm that SecureCRT is installed or upgraded to 4.0 or above. I am currently using 4.1 and then start the configuration.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.hzqbbc.com/images/openssh_scrt_howto/step1.gif'); ">
Step 1: Open the Host Name Record for which you want to configure the certificate. After selecting the host name, click the icon in the red box in the figure to go to the detailed configuration interface of the host.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.hzqbbc.com/images/openssh_scrt_howto/step2.gif'); ">
Step 2: On the Connection page, set Username to the user you want to log on to. This user is the user who just created the certificate. note this. In Connection --> Authentication, select PublicKey for the Primary Authentication method and click "Properties ".
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.hzqbbc.com/images/openssh_scrt_howto/step3.gif'); ">
Step 3: select the Use session public key, which means that different certificates are used for different sessions, which is useful for system administrators who manage a large number of hosts. If you only want to maintain a small number of machines, you can consider using the same set of certificates.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.hzqbbc.com/images/openssh_scrt_howto/step4.gif'); ">
Use identity file to open "... "button, browse my computer, find the C: \ SSH directory, then see the id_dsa and id_dsa.pub files, select the id_dsa file, and then click OK, you can see the path is C: \ SSH \ id_dsa.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.hzqbbc.com/images/openssh_scrt_howto/step5.gif'); ">
Save the configuration, disable SecureCRT, and then open the host with the certificate configured. Normally, you will be prompted to enter the key encryption word. after entering the key, you should be able to log on to the system.
Open another SCRT window. Log on to the same host. Because SCRT has cached certificates and encryption characters, you no longer need to enter the user name and password. This is very convenient to use!
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