Ubuntu starts the SSH service remote login operation

Ubuntu starts the SSH service remote login operation

ssh-secure shell, provides secure remote login. When developing embedded systems and setting up a Linux development environment, installing the SSH service is an essential step. SSH makes it convenient for people in a development team to log in to a server to write, compile, and run code. Facilitates code sharing and management. SSH is a security protocol that is mainly used to encrypt remote login session data to ensure the security of data transmission.

0. SSH is divided into clients openssh-client and openssh-server

If you just want to log in to another machine's SSH, you only need to install openssh-client (Ubuntu has it installed by default, if not, then sudo apt-get install openssh-client). If you want to open the SSH service on this machine, you need to install openssh-server.

1. Check whether the ssh-server service is installed in the current Ubuntu. By default, only the ssh-client service is installed.

dpkg -l | grep ssh 

2. Install ssh-server service

sudo apt-get install openssh-server 


Check the installed services again:

dpkg -l | grep ssh 


Then confirm that ssh-server is started:

ps -e | grep ssh 


If you see sshd, it means ssh-server has been started.

If not, you can start it like this: sudo /etc/init.d/ssh start or sudo service ssh start

Configuration related:

The ssh-server configuration file is located in /etc/ssh/sshd_config, where you can define the SSH service port. The default port is 22, and you can define it to other port numbers, such as 222. (Or add a "#" sign to "PermitRootLogin without-password" in the configuration file to comment it out, and then add a sentence "PermitRootLogin yes")

Then restart the SSH service:

sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start

3. Log in to SSH (Linux)

ssh [email protected]
Among them, username is the user on the 192.168.1.103 machine, and the password needs to be entered.
Disconnect: exit

4. Testing

(1) Server: 192.168.1.103 (user jackgao)


(2) Client: 192.168.1.104 (root user)


(3) Client remote ssh login server


(4) Exit remote login

In addition, if the SSH service is installed, you can use xshell or putty to connect to this Ubuntu under Windows (but you have to enter the username and password every time. Even if xshell can store the username and password, the login speed is very slow. So you can use the public key login method to improve speed and security.

Reference links and related:

1. Ubuntu starts the SSH service
http://www.cnblogs.com/xiazh/archive/2010/08/13/1798844.html
2. Ubuntu 14.04 remote login server – ssh installation and configuration
http://jingyan.baidu.com/article/9c69d48fb9fd7b13c8024e6b.html
3. How to install and use ssh in Ubuntu 14.04
http://jingyan.baidu.com/article/0eb457e52e50ad03f1a90518.html
4. Ubuntu 16.04 installation + xshell connection to virtual machine
http://blog.csdn.net/chi_wawa/article/details/52467914
5. Ubuntu SSH configuration and file transfer with xshell
http://blog.sina.com.cn/s/blog_53683dc20102v3wz.html
6. Simple example of ssh remote login command
//www.jb51.net/os/201307/228495.html
7. Linux for Beginners Series: [4] SSH password-free login to remote server
http://jingyan.baidu.com/article/2fb0ba4043124a00f2ec5f0f.html
8. Getting started with SSH remote login to a server under Linux
http://www.cnblogs.com/plwang1990/p/5279451.html

This is the end of this article about how to enable SSH service remote login operation in Ubuntu. For more information about how to enable SSH service remote login operation in Ubuntu, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Python pexpect ssh remote login server method
  • ssh changes the default port number and implements password-free remote login
  • Novice learn Linux commands: ssh command (remote login)
  • SSH remote login and port forwarding detailed explanation
  • How to modify SSH port and disable root remote login in centos 6.5
  • Linux remote login ssh password-free configuration method

<<:  Mysql implementation of full-text search and keyword scoring method example

>>:  8 essential JavaScript code snippets for your project

Recommend

Basic statements of MySQL data definition language DDL

MySQL DDL statements What is DDL, DML. DDL is dat...

MySQL process control IF(), IFNULL(), NULLIF(), ISNULL() functions

In MySQL, you can use IF(), IFNULL(), NULLIF(), a...

Mysql aggregate function nested use operation

Purpose: Nested use of MySQL aggregate functions ...

MySQL uses aggregate functions to query a single table

Aggregate functions Acts on a set of data and ret...

About VSCode formatting JS automatically adding or removing semicolons

introduction It is okay to add or not add a semic...

Analyze the working principle of Tomcat

SpringBoot is like a giant python, slowly winding...

Specific use of MySQL segmentation function substring()

There are four main MySQL string interception fun...

How to use html table (to show the visual effect of web page)

We know that when using HTML on NetEase Blog, we ...

mysql command line script execution example

This article uses an example to illustrate the ex...

Optimal web page width and its compatible implementation method

1. When designing a web page, determining the widt...

How to implement the jQuery carousel function

This article shares the implementation code of jQ...

Docker container accesses the host's MySQL operation

background: There is a flask project that provide...

MYSQL slow query and log settings and testing

1. Introduction By enabling the slow query log, M...