The Ubuntu platform is not all the software is as easy as the win platform, such as SSH client putty, svn graphical version of the unsatisfactory, groped, decided to return to the command line, after all, Linux
Down to the terminal relative to win platform under the simulation DOC environment efficiency is still higher.
The following is a brief introduction to OpenSSH, reference from http://www.cnblogs.com/xdzone/archive/2011/03/09/1978327.html
Platform: Ubuntu 14.04 LTS
1. Overview
Traditional Telnet (telnet,rlogin) is not secure, they transmit passwords and data in plaintext on the network, SSH is secure, and OpenSSH provides two levels of authentication.
(1) Password-based security authentication: Know the server's account password can be telnet, password and data in the transmission process will be encrypted.
(2) Key-based Security authentication: At this point you need to create a pair of keys, the public key to the remote server in its own host directory, and the private key is saved by themselves.
2. Software Installation
sudo apt-cache policy openssh-client openssh-server Check to see if the software is installed
Service side: sudo apt-get install Openssh-server
Client: sudo apt-get install openssh-client (ubuntu10.10 for installation)
The package also carries some other SSH tools, such as Ssh-keygen used to generate private/public key pairs,SCP can be used to remotely copy files via ssh,STFP can be implemented FTP transfer files
3. Configuration files
[Email protected]:/etc/ssh$ ls-l
Total 148
-rw-r--r--1 root root 125749 2010-09-15 02:34 moduli//ssh server Diffie-helllman key file
-rw-r--r--1 root root 1669 2010-09-15 02:34 ssh_config//ssh Client configuration file
-rw-r--r--1 root root 2453 2011-03-09 14:09 sshd_config//ssh server-side configuration file
-RW-------1 root root 672 2011-03-09 14:09 ssh_host_dsa_key//ssh server-side DSA algorithm private key
-rw-r--r--1 root root 613 2011-03-09 14:09 ssh_host_dsa_key.pub//SSH server RSA public key
-RW-------1 root root 1675 2011-03-09 14:09 ssh_host_rsa_key//SSH server RSA algorithm private key
-rw-r--r--1 root root 405 2011-03-09 14:09 SSH_HOST_RSA_KEY.PUB/SSH server RSA algorithm public key
4. Common commands
Sudo/etc/init.d/ssh start/stop/restart/status//is used to start the SSH service, if the server is not installed, you will be prompted to SSH command cannot find
5. Password-based authentication
SSH 192.168.0.143/host name (server IP 192.168.0.143)
There is a lot of information when you first log on to the server, because SSH does not recognize the host, and when you enter yes it will write the information to the ~/.ssh/known_hosts file, which will not appear the next time you log in.
6. Key-based authentication
(1) Generate key ssh-keygen-t RSA/DSA (default RSA)
Generate private key: ~/.ssh/id_rsa, public key ~/.ssh/id_ Rsa.pub, the public key needs to be copied to the remote server, so that when the server is logged on, client will request the item server, authenticate with the private key, and when the server receives the request, look for the public key for authentication
(2) SCP id_rsa.pub 192.168.0.143:.ssh/authorized_keys and ensure that the permissions are 644.
(3) SSH 192.168.0.143 if the private key password is set during the Ssh-keygen process, a private key password is required during the logon process. Otherwise, the direct login is complete.
7.SCP Simple to use
SCP Ip1:file1 Ip2:file2
The first parameter is the source file, the second target file, and the IP or hostname can be omitted when the parameter is an SSH login to the host. When the two parameter is the IP of two remote hosts, the file transfer between the two remote hosts can be implemented.
EG:SCP 192.168.0.143:/home/zone/1.sh Localhost:/home/erpang from the server download 1.sh to the local host Erpang directory, if it is native, localhost: can be omitted, Directly written as SCP 192.168.0.143:/home/zone/1.sh/home/erpang
Use OpenSSH client instead of putty under Ubuntu platform