【Linux】ubuntu安装ssh服务端openssh-server

  • 1、背景
  • 2、解决办法
  • 3、测试

1、背景

ubuntu安装后默认只有ssh客户端,只能去连其它ssh服务器;
其它客户端想要连接这个ubuntu系统,需要安装部署ssh服务端!

Secure Shell(SSH)是一种加密网络协议,用于在不安全的网络上安全地运行网络服务。
利用SSH可以实现加密并安全地远程登录计算机系统。

2、解决办法

安装命令如下:

sudo apt install openssh-server

详细安装日志:

yus@jn10010537:~/Test$ sudo apt install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:molly-guard monkeysphere rssh ssh-askpass
The following NEW packages will be installed:ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 upgraded, 4 newly installed, 0 to remove and 10 not upgraded.
Need to get 637 kB of archives.
After this operation, 5,316 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 ncurses-term all 6.1-1ubuntu1.18.04 [248 kB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 openssh-sftp-server amd64 1:7.6p1-4ubuntu0.3 [45.6 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 openssh-server amd64 1:7.6p1-4ubuntu0.3 [333 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 ssh-import-id all 5.7-0ubuntu1.1 [10.9 kB]
Fetched 637 kB in 1s (458 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... 190012 files and directories currently installed.)
Preparing to unpack .../ncurses-term_6.1-1ubuntu1.18.04_all.deb ...
Unpacking ncurses-term (6.1-1ubuntu1.18.04) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-sftp-server (1:7.6p1-4ubuntu0.3) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-server (1:7.6p1-4ubuntu0.3) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_5.7-0ubuntu1.1_all.deb ...
Unpacking ssh-import-id (5.7-0ubuntu1.1) ...
Setting up ncurses-term (6.1-1ubuntu1.18.04) ...
Setting up openssh-sftp-server (1:7.6p1-4ubuntu0.3) ...
Setting up ssh-import-id (5.7-0ubuntu1.1) ...
Setting up openssh-server (1:7.6p1-4ubuntu0.3) ...Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:UVU9dG8lhh4sAvp68p7I/V2I3VEkQcqLJopXcgbqARw root@ts006-MS-7A94 (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:Nh0RpvlORi2IRD5r6T/SHEZFfcJRlkKIJxRZ4kgu3pc root@ts006-MS-7A94 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:NbjnEQNRR8UHfUyt1Wl+PrfMkHev6y3PxeunU+cQhJQ root@ts006-MS-7A94 (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (237-3ubuntu10.39) ...yus@jn10010537:~/Test$ sudo ifconfig
[sudo] password for yus:
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.1.104  netmask 255.255.255.0  broadcast 192.168.1.255inet6 fe80::a11d:bb94:cfa3:1f2f  prefixlen 64  scopeid 0x20<link>ether 00:d8:61:18:0d:95  txqueuelen 1000  (Ethernet)RX packets 5268399  bytes 4657862121 (4.6 GB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 24091941  bytes 23694574458 (23.6 GB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0device interrupt 16  memory 0x92f00000-92f20000  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1000  (Local Loopback)RX packets 2934074  bytes 23413782285 (23.4 GB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 2934074  bytes 23413782285 (23.4 GB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0yus@jn10010537:~/Test$

3、测试

在windows下安装git,通过git Bash进行ssh安全通信。
注意:windows10机器与ubuntu机器是同一网段,即192.168.1.x !

如下表示连接成功 !

Administrator@PJ9NM MINGW64 ~
$ ssh yus@192.168.1.104
yus@192.168.1.104's password:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-51-generic x86_64)
* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage
* Canonical Livepatch is available for installation.- Reduce system reboots and improve kernel security. Activate at:https://ubuntu.com/livepatch
11 packages can be updated.
0 updates are security updates.
Your Hardware Enablement Stack (HWE) is supported until April 2023.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
yus@jn10010537:~$

【Linux】ubuntu安装ssh服务端openssh-server相关推荐

  1. Linux (Ubuntu)安装SVN服务端详细篇

    1 先查看是否已经安装了svn: 如果没有安装svn则: root@houwp:~# svn --version The program 'svn' is currently not installe ...

  2. Linux ubuntu 安装ssh服务

    1.安装 sudo apt-get install openssh-server 2.启动与停止 /etc/init.d/ssh start //启动/etc/init.d/ssh stop //停止 ...

  3. Ubuntu安装SSH服务和NFS服务、TFTP服务

    一.SSH安装 摘要:在使用SSH服务或NFS服务.TFTP服务之前,需要理解其架构,其架构就是典型的C/S架构,说白就是服务端提供给客户端服务,客户端请求服务端资源的这么一种方式. 1.window ...

  4. Ubuntu 安装 SSH 服务

    Ubuntu 安装 SSH 服务 1.安装 SSH 服务器,查看报错信息 sudo apt-get install openssh-server 2.根据报错显示的内容,需要安装对应的 openssh ...

  5. Ubuntu安装ssh服务(避坑指南)

    Ubuntu安装ssh服务 前言 相关软件 操作步骤 后记 参考文章 前言 进行环境搭建时,想用Xshell连接虚拟机,但总提示" Connect fail-".查找了许多资料,才 ...

  6. Ubuntu安装git服务端

    windows wsl ubuntu安装git服务 基础安装 下载安装git 安装git $ sudo apt-get install git-all 说明:如果安装过程出现找不到包的错误: E: U ...

  7. kali linux 的ssh服务器,如何在 Kali Linux 上安装 SSH 服务

    目的 我们的目的是 Kali Linux 上安装 SSH(安全 shell). 要求 你需要有特权访问你的 Kali Linux 安装或者 Live 系统. 困难程度 很容易! 惯例 #– 给定命令需 ...

  8. ubuntu 安装 ssh 服务并使用 root 登录

    1.安装 ssh 服务 sudo apt-get install openssh-server -y 2.设置 roo t密码,ubuntu 默认 root 密码是随机的,需要重置一下 sudo pa ...

  9. ubuntu安装ssh服务命令

    由于测试华为的方舟编译器,然而方舟编译器的环境采用ubuntu16.04的环境.所以我安装了一个全新的ubuntu16.04的系统,让我很失望的是ssh服务竟然集成进入16.04的版本.至此需要通过自 ...

最新文章

  1. Flask-sqlalchemy外键关系映射
  2. 黄聪:visual studio 2017编译运行出现脚本发生错误等问题如何解决?
  3. bzoj4025-二分图【线段树分治,并查集】
  4. Linux安装配置类似mac下的docky
  5. AjaxPro 未定义错误
  6. elementui表格列宽自适应_Java 操作Word表格——创建嵌套表格、添加复制表格行或列...
  7. 浙大研究生hadoop工作分享
  8. starway(NOIP模拟测试24)
  9. SECS/GEM概念
  10. 微信小程序弹窗提示怎么写
  11. mysql创建数据库_MySQL创建数据库的两种方法
  12. 跳转到高德地图或百度地图或高德网页导航
  13. 美式期权损益图matlab,一看就懂,盈亏全在图上了,超实用的期权损益图绘制
  14. C# Win32API 模拟鼠标移动及点击事件
  15. Lake Shore PT-100铂电阻温度传感器
  16. UWB的定位算法(简单详细易懂)
  17. Python3中小括号()、中括号[]、花括号{}的区别
  18. html封面设计图片手绘大全,本子封面设计手绘素描图片欣赏
  19. html5仿抖音全屏播放,仿抖音视频全屏播放滑动切换
  20. 【滤镜】CVPixelBufferRef处理成黑屏+水印

热门文章

  1. 麦克风波束成形的基本原理
  2. 《深度工作》一书摘抄
  3. 模态对话框与 非模态对话框
  4. Python debug 模块之pdb--(一)
  5. 刘海屏全屏显示(主要是隐藏状态栏且布局在状态栏位置上生效)
  6. 2013国内IT行业薪资对照表【技术岗位】
  7. windll.user32.ReleaseDC failed : return 0
  8. 干掉苹果技术黑色产业,追回过亿资金!
  9. django进入admin报错ORA-00918:column ambiguously defined
  10. 【排序算法全解】之 - 插入排序(InsertSort)