本人在ubuntu16.4.4.0-13下测试

#man uname//用于打印系统信息

sudo apt install update

sudo apt install openssh-server

若是出现:

解决方法:

gedit /ect/ssh/sshd-config

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22 #可以更改端口,但ssh链接是要指明端口号
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0#可以指点某个地址,出于某个安全需要
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
#PermitRootLogin prohibit-password#要把这一项注释,才能远程登录root用户
PermitRootLogin yes#增加这一项,
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes#是否允许密钥链接
#AuthorizedKeysFile    %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

修改完后,启动服务

先查看端口开启情况

ss -antpl

sudo service ssh start  (如果是kail linux >> systemctl start  ssh  )

查看进程

sudo ps -e |grep ssh

看到有sshd服务就可以啦

ubuntu搭建ssh服务的更多相关文章

  1. Ubuntu 开启SSH服务以及有关设置:安装,指定端口号、免密登录、远程拷贝

    本文所用系统为 Ubuntu 18.04   什么是SSH?     简单说,SSH是一种网络协议,用于计算机之间的加密登录.全名为:安全外壳协议.为Secure Shell的缩写.SSH为建立在应用 ...

  2. 在windows上搭建SSH服务踩过的坑

    前两天安装了windows操作系统,想在windows上做内网穿透,所以就想在windows下启用ssh服务,今天就来讲一下我在搭建ssh服务中遇到的坑. 我显示在Mac下搭建了ssh服务,并且测试通 ...

  3. ubuntu开启SSH服务远程登录

    http://blog.csdn.net/jackghq/article/details/54974141 ubuntu开启SSH服务远程登录

  4. Ubuntu配置SSH服务

    本文主要解决Ubuntu配置SSH服务的问题 1.1.修改可用的agt源 sudo vim /etc/apt/sources.list 1.2.更新代码包 sudo apt-get update 2. ...

  5. ubuntu 搭建Mercurial 服务(nginx)

    ubuntu 搭建Mercurial 服务(nginx) 环境:ubuntu 12.05  Mercurial 步骤: (1)安装nginx 和 Mercurial: sudo apt-get ins ...

  6. ubuntu开启SSH服务

    SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-g ...

  7. 如何开启ubuntu的SSH服务

    buntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server,然而SSH分客户端openssh-client和服务端openssh-server,opens ...

  8. [转] ubuntu开启SSH服务

    点击阅读原文 SSH分客户端openssh-client和openssh-server如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo ...

  9. Ubuntu安装SSH服务

    1 SSH服务 Ubuntu默认并没有安装ssh服务,如果通过ssh远程连接到Ubuntu,需要自己手动安装ssh-server(openssh-server). 1.1 检测是否安装SSH服务 出现 ...

随机推荐

  1. SQL Server中四类事务并发问题的实例再现(转)

    本篇文章将用实例再现数据库访问中四类并发问题,希望能让初学者能对事务的并行性有进一步的理解. 首先,让我们先来了解一下并行问题以及事务隔离级别这两个概念.在数据库中,假设如果没有锁定且多个用户同时访问 ...

  2. springboot2.1.7整合Druid

    一.maven的依赖:文中就贴重点的, 其他依赖就不贴了 <dependency> <groupId>com.alibaba</groupId> <artif ...

  3. easypoi 版本依赖关系

    <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactI ...

  4. mysql5.7 环境准备

    原文源自:https://www.cnblogs.com/activiti/p/7810166.html 操作系统为centos7 .修改 /etc/my.cnf,在 [mysqld] 小节下添加一行 ...

  5. h5构建页面(rem布局准备)

    新建一个flex.js ! function () { function t(t) { return this.config = t, this } t.prototype = { reset: fu ...

  6. Module parse failed: Export 'instance' is not defined (35:19)

    Module parse failed: Export 'instance' is not defined (35:19) 使用npm出现的这错误,用yarn就可以了 这种情况rm node_modu ...

  7. webpack-dev-server 和 html-webpack-plugin的使用

    webpack-dev-server的作用:自动编译 1.webpack-dev-server的使用 1)cnpm i webpack-dev-server -D 2)在package.json中配置 ...

  8. string str = File.ReadAllText(@"c:\temp\ascii.txt");

    string str = File.ReadAllText(@"c:\temp\ascii.txt");

  9. 远程管理FTP

    FTP默认路径 建立pub目录(注意不是文件) LeapFTP使用 注:上传到服务器的pub文件下,不要弄错目录. 在本地计算机利用LeapFTP与FTPServer进行数据的传输,但是FTPServ ...

  10. django分页模块--django-pure-pagination

    Django自带有分页的两个类,但是用起来没有第三方这个分页模块方便,下面介绍一下这个模块的使用方法. 1. 安装模块: pip install django-pure-pagination 2.   ...