SSH to Secure Shell abbreviation. Developed by the IETF Networking Workgroup (Network Working Group), which builds on the application-layer and transport-layer security protocols.
SSH is now a more reliable protocol that provides security for Telnet sessions and other network services. often used for remote logins, and for copying data between users.
The use of SSH protocol can effectively prevent the information leakage in the remote management process. SSH was originally a program on a UNIX system. It later expanded quickly to other platforms.
SSH can compensate for vulnerabilities in the network when it is used correctly. SSH client is available on a variety of platforms. Nearly all UNIX platforms-including HP-UX, Linux, AIX, Solaris, Digital UNIX, Irix, and other platforms-can execute SSH.
Installation of related tools
Installation of SSH server:
sudo apt-get install Openssh-server
Installation of SSH client:
sudo apt-get install openssh-client
client and server relationship : Suppose that A machine wants to be controlled remotely by A B machine. So. A machine needs to install SSH server,b machine to install SSH client.
If a failure occurs during use. To restart the SSH server:
sudo service ssh restart
Test use
Operation command:ssh-l username HostIP
ssh : command
- l : option is the letter "L", not the number "1"
username: User name for Telnet
hostip: The IP address that was Telnet
To view the IP that is remotely remote:
telnet (Here is the user Wencong (A machine) remote login edu (B machine)). Ability to use sudo:
SSH informs the user. This host is not recognized, then type "yes". SSH will have the relevant information. Write in "~/.ssh/know_hosts". Once again, there will be no such information . Then after entering the password, you can log in to the host.
Then. Prompt to enter login password:
Login success:
Suppose you want to telnet to Linux under the Windows platform. This time Windows needs to install the Xmanager package.
Xmanager is a software package.
including Xshell, Xftp, Xstart and other software.
Xshell: is an ssh, TELNET, and RLOGIN terminal software under the Windows platform.
It makes it easy and secure for users to access Unix/linux hosts on the Windows platform.
Xftp: is an FTP and SFTP file transfer program that is applied to the Windows platform. Xftp can safely transfer files between Unix/linux and Windows platforms.
Xstart: Agreed to remotely use the graphical interface to access the server, but the efficiency is slightly lower, only support the GNOME desktop.
Here, we use the Xshell software, for more details, see: "Building and using the Linux development environment – remotely connecting to Ubuntu via Xshell."
SSH Configuration
SSH installation, there is no default user profile, we can according to their own needs to configure.
Like the example above. We want to log on to the EDU user on 10.221.20.16. We have to knock "ssh-l edu 10.221.20.16" every time.
Here's how to simplify this command.
To create a file config under ~/.ssh:
Write in config such as the following:
later. Execute "SSH edu" on the command line to log on to the EDU user on 10.221.20.16:
Note: The first line of config is assumed to be Host *test . The command becomes:SSH test. test the name according to the need to self-naming, hit the name match on the.
Of course, there are many other options, such as Forwardagent, Compression, ForwardX11 Fallbacktorsh and so on. There is no listing here.
Copy files and folders with "SCP"
SSH provides a number of commands and shells used to log on to remote server.
By default, the user is not agreed to copy the file, but still provides an "SCP" command, such as the following:
Local file copy to remote:
SCP FileName [Email protected]:remotefile
SCP FileName Remotehostip:remotefolder
SCP FileName Remotehostip:remotefile
Copy Local folder to remote:
Scp-r FolderName [Email protected]:remotefolder
Scp-r FolderName Remotehostip:remotefolder
Remote file copy to Local:
SCP [Email Protected]:remotefile FileName
SCP Remotehostip:remotefolder FileName
SCP Remotehostip:remotefile FileName
Remote folder Copy to Local:
scp-r [Email Protected]:remotefolder FolderName
Scp-r Remotehostip:remotefolder FolderName
This is just a test of a command, and the other operations are similar.
Remote file copy to Local:
SCP [Email Protected]:remotefile FileName
remoteusername: Remote username
remotehostip: Remote IP
remotefile: Remote file. Can be carried on the path
FileName: The name to be copied to the local, with the path on it. Copy to current folder without path
To view remote folders and files:
To view local folders and files:
To copy remote files:
Copying a remote file can change its name:
Copying remote files allows you to specify a storage path:
Copyright notice: The blog post, I write the main is to collate, or collect in a network, reproduced please indicate the source!!
Building and using the Linux development environment--linux this prerequisite software ssh