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.