Managing Intranet Linux Using SSH reverse connections

Source: Internet
Author: User
There is a linux computer in the Intranet, and an independent IP server in the public network. If you want to operate the Intranet computer anywhere, you can use ssh reverse connections to solve this problem and record it. SSH automatically logs on to the client to generate ssh keycd ~. Ssh # generate the public key file (id_dsa.pub) and private key file (id_dsa), type DSA, Length: 1024 bits # contact us

There is a linux computer in the Intranet, and an independent IP server in the public network. If you want to operate the Intranet computer anywhere, you can use ssh reverse connections to solve this problem and record it.

SSH Automatic Logon

Ssh key generated by the client
Cd~ /. Ssh
# Generate a public key file (Id_ Dsa. pub) and private key file (id_dsa), type DSA, length 1024 bits
# Note: Press enter directly when querying passphrase.
Ssh-keygen-t dsa-B 1024
# Copy the public key to the remote host
SCpId_dsa.pub Server :~ /. Ssh/id_dsa.pub.Client2. Server:
 
Log on to the server
Cd ~ /. Ssh
# Put the Client's public key into the Server's Trust List
CatId_dsa.pub.Client> authorizEd_ Keys
# Updating permissions is very important
Chmod0600 *
From then on, do not manually enter the password when logging on to the Server through Client SSH.


Local script (pssh)

KillAll ssh
Ssh-R 8080: localhost: 22-N user @ Server


Crontab-E

3 */2 *** sh/home/user/pssh

Manage intranet computers
Ssh-p 8080 user @ localhost on the server


It is not a stable and reliable method, but can only be used. It may be better to use autossh, but the experiment fails. Ubuntu 10.4 For the Intranet and Centos 5.5 for the Internet server.

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.