Recently re-entered the overseas server, want to toss something, has not used the server for almost a year, forget a lot of things, this time to do the side of the memory while learning
First of all, you have to log in.
# SSH [Email protected]
Enter the password on the line, by the way. The default password for the server you are purchasing is%x5ph.] ap$2{.? *CJ look at the safety of not ...
and change the password first.
# passwd Root
An incredibly basic Linux command
And then go with SSH.
First, what is SSH
SSH I first use or in the use of GitHub, SSH is secure Shell, is a convenient security authentication services, simply speaking is their own terminal production of their own secret key, as an identity, the server over there to add this key, so every time to SSH link, The server will check your logo, found that you have saved this logo, it means to know this terminal, directly allow the login
The generation of SSH is not specifically said.
Ssh-keygen -t rsa-c '[email protected]'
After the build, you need to put the logo into the server
SCP ~/. SSH
This command is actually to copy the file, the ~/.ssh/id_rsa.pub copy of the machine to [email protected]:~/go, this time because there is no login, so will enter the login password
Enter the password after the server's ~/path has a id_rsa.pub file, this time on the server to continue operations can be
cat id_rsa.pub >>. SSH
Import the contents of the id_rsa.pub. Ssh/authorized_keys, so that even if the completion of the recognition, as long as the direct SSH [email protected] can login
But the IP address is not so good to remember, but also bad input, this time can be configured for SSH, open ~/.ssh/config if not created
Write in config
Host mynamehostname xx.xx.xx.xxxPort #ssh服务器端口, the default is 22User rootidentityfile ~/. SSH/id_rsa
MyName is a custom name for this host, fill in the following, even if the server-related information, port with the default of 22 can be, identityfile fill in the SSH key to use
This config is written right after the direct
ssh myname
You can log in.
Cond
MacOS uses a CentOS remote server