本人在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. 一例jsonp跨域访问

    对于网站A,有一链接 '/auth/list',返回json数据 {, , , , , },{, , , , , }]} 网站b某页面下可以这样写jsonp get请求 <script> ...

  2. mongoTemplate CURD 和模糊查询(转)

    此文基于Spring的MongoTemplate,介绍MongoDB比较基础常用的增删改查操作.涵盖了从集合创建.索引创建和CRUD操作到更高级的功能(如Map-Reduce和聚合)等等.不多说,直接 ...

  3. EntityManager的merge()方法

    EntityManager的merge()方法相当于hibernate中session的saveOrUpdate()方法: 用于实体的插入和更新操作:

  4. sql 同一行中,不同结果在不同列显示

    对不同条件查询到的结果在同一行中展示 尝试写过使用","和inner join两种方式,感觉使用","的更加直观 select table1.guid, tab ...

  5. canvas addHitRegion()

    CanvasRenderingContext2D.addHitRegion() 是 Canvas 2D API 给位图添加点击区域的方法. 但是 mobile 都不兼容

  6. 洛谷 P1341 无序字母对(欧拉路)

    P1341 无序字母对 题目提供者yeszy 标签 福建省历届夏令营 难度 提高+/省选- 最新讨论 题目描述 给定n个各不相同的无序字母对(区分大小写,无序即字母对中的两个字母可以位置颠倒).请构造 ...

  7. 灰度图像--频域滤波 傅里叶变换之离散傅里叶变换(DFT)

    学习DIP第23天 转载请标明本文出处:http://blog.csdn.net/tonyshengtan,欢迎大家转载,发现博客被某些论坛转载后,图像无法正常显示,无法正常表达本人观点,对此表示很不 ...

  8. 微信小程序搭建mpvue+vant+flyio

    导语 上一篇文章微信小程序搭建mpvue+vant已经介绍了如何搭起mpvue项目及引入vant,本篇文章继续在它的基础上,引入flyio,并做一些封装,目的是为了在小程序发起请求. 这时读者会有些疑 ...

  9. Maven-项目管理(一)_认识Maven

    Maven是什么? Maven是Apache下的项目管理工具,它由纯Java语言开发,可以帮助我们更方便的管理和构建Java项目. 为什么要使用Maven? 1. jar包管理: a) 从Maven中 ...

  10. docker安装中文版Gitlab服务端

    1.pull中文版镜像: docker pull beginor/gitlab-ce:11.3.0-ce.0 2.创建目录: 通常会将 GitLab 的配置 (etc) . 日志 (log) .数据 ...