Enable the ssh service in Ubuntu

Source: Internet
Author: User
Tags ssh secure shell
Ssh programs include the client program openssh-client and the server program openssh-server. If you need to log on to another computer through ssh, you need to install openssh-client. This program is installed in Ubuntu by default. To remotely connect to the local machine, you must install openssh-server. Installing openssh-server in Ubuntu is very simple. Install openssh-server $ sudoapt

Ssh programs include the client program openssh-client and the server program openssh-server. If you need to log on to another computer through ssh, you need to install openssh-client. This program is installed in Ubuntu by default. To remotely connect to the local machine, you must install openssh-server. Installing openssh-server in Ubuntu is very simple.

Install openssh-server
$ Sudo apt-get install openssh-server

Check whether openssh-server is enabled
$ Ps-e | grep ssh
Process ssh-agent is the client, and sshd is the server. If the result contains a sshd process, it indicates that openssh-server has been started. If not, run the command to start it.

The command to start, stop, and restart openssh-server is as follows:
/Etc/init. d/ssh start
/Etc/init. d/ssh stop
/Etc/init. d/ssh restart

Configure openssh-server
The openssh-server configuration file is located in/etc/ssh/sshd_config. Here, you can configure the SSH service port. For example, the default port is 22 and can be customized to another port number, such as 222, then restart the SSH service.

Disable ssh logon to the root user
It is very dangerous to open the ssh root permission, so it is not particularly necessary. You should disable this permission and find a line of PermitRootLogin yes in the configuration file/etc/ssh/sshd_config, change yes to no and restart ssh.

Configure openssh-server in Ubuntu to automatically start upon startup
Open the/etc/rc. local file and add the following before the exit 0 statement:
/Etc/init. d/ssh start

About Client Connection
The Client can use SSH Client software such as putty, SecureCRT, and SSH Secure Shell Client, enter the IP address of your server, and enter the login user and password to log on. The client software I often choose is putty.

Ssh Encryption
In fact, ssh is much more used than that. ssh also has a very important part, that is, ssh is encrypted through the public key and private key. For example, git can be accessed through encrypted ssh. Ssh encryption is not discussed here for the time being. If you have the opportunity to add it, you can view the relevant information.

Related reading:

The whole process of configuring SSH service under Ubuntu and the solution of http://www.linuxidc.com/Linux/2011-09/42775.htm

Install Git, SSH and Permission denied solutions in Ubuntu 12.04 http://www.linuxidc.com/Linux/2013-06/85336.htm

Ubuntu 12.10 OpenSSH offline Installation Method http://www.linuxidc.com/Linux/2013-04/82814.htm

Install or set http://www.linuxidc.com/Linux/2013-07/87368.htm in SSH under Ubuntu

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.