Currently, most Linux distributions have pre-installed SSH clients that can connect to other people's computers. But there are exceptions to the situation, so, the following first SSH client and server installation together to talk about it.
SSH client and server installation is very simple, after opening the terminal, only need two commands:
sudo apt-get install openssh-Client # #这是安装客户端sudo apt-get install Openssh-server # #这是安装服务端
When the default installation is complete, the service is turned on automatically, and can be viewed through ps-e | grep ssh , which indicates success if Ssh-agent appears. How do you shut down a server if you don't want someone else to log on to your computer? Very simple, just enter
sudo service ssh stop
It's done, easy,:-). What about opening it again? Smart you must have thought that just enter
sudo service ssh start
The service is open again, convenient! (*^__^*) hehe ...
OK, after installing the SSH client and server, let's log in to our computer and try it out.
In Terminal input:
SSH [email protected]
USR is a username, hostname is the name of your host, like my host name is Ubuntu, because my Linux distribution is Ubuntu, if I want to use flyingrain this user login Ubuntu this host, you can lose:
SSH [email protected]
As long as you enter this user's password can be logged in, is not very convenient?
OK, let's log in to the remote computer and try it out. If you want to log in to a remote computer, you need to have SSH server installed. Let's say my friend's computer is already installed on the SSH server, so I can do this to log in to his computer:
[Email protected]
Also usr refers to a user of the computer, IP refers to the computer's IP address (so the remote computer connected to the best use of static IP). Executing this command will let you enter the password, just enter the USR password. If this is the first connection, then the server will ask you if your online key has not been established, would you like to accept the key from the server and build it online? Oh! This time please "be sure to enter yes instead of Y or y" so that the program will accept Oh!
After the connection, you can achieve the purpose of remote control host, and operate almost like the operation of their own computer
How Ubuntu uses SSH to connect remote computers