Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ssh to connect to remote computer in ubuntu

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Ubuntu how to use ssh to connect to remote computers, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

The installation of ssh client and server is very simple. After opening the terminal, you only need two commands:

The code is as follows:

Sudo apt-get install openssh-client # # this is to install the client

Sudo apt-get install openssh-server # # this is the installation server

The service is enabled automatically after the default installation is completed, which can be viewed through ps-e | grep ssh. If ssh-agent appears, the service is enabled successfully. So how do you shut down the server if you don't want someone else to log on to your computer? It's simple, just enter

The code is as follows:

Sudo service ssh stop

It's done, it's simple: -) what about opening it again? Smart you must have thought that as long as you type

The code is as follows:

Sudo service ssh start

The service will be turned on again, convenient! (* ^ _ ^ *) hee hee.

OK, after installing the client and server of ssh, let's log in to our own computer.

At the terminal, enter:

The code is as follows:

Ssh usr@hostname

Usr is a user name, and hostname is the name of your host, for example, my host name is ubuntu, because my linux distribution is ubuntu. If I want to log in to ubuntu with the user flyingrain, I can enter it like this:

The code is as follows:

Ssh flyingrain@ubuntu

It is convenient to log in as long as you enter the user's password again.

OK, let's try logging in to the remote computer now. To log in to a remote computer, you need a server equipped with ssh. Suppose my friend's computer has been installed with the ssh server, so I can do this to log in to his computer:

The code is as follows:

Ssh usr@ip

Similarly, usr refers to a user of the computer, and ip refers to the ip address of the computer (so it is best to use a static ip on a connected remote computer). After executing this command, you will be asked to enter your password, just enter the password of usr. If this is the first time to connect, Server will ask you, your online Key has not been established, do you want to accept the Key from Server and establish an online connection? He he! At this time, please "be sure to enter yes instead of y or Y", so that the program will accept it!

After reading the above, have you mastered how to use ssh to connect to a remote computer in ubuntu? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report