共計 2590 個字符,預計需要花費 7 分鐘才能閱讀完成。
本篇內容主要講解“Ubuntu 下 openssh server 如何安裝和使用”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓丸趣 TV 小編來帶大家學習“Ubuntu 下 openssh server 如何安裝和使用”吧!
事前準備
ubuntu 版本:17.10
devops@ubuntu:~$ cat /etc/issue
ubuntu 17.10 \n \l
devops@ubuntu:~$
devops@ubuntu:~$ lsb_release -a
no lsb modules are available.
distributor id: ubuntu
description: ubuntu 17.10
release: 17.10
codename: artful
devops@ubuntu:~$
17.10 的 ubuntu 代號 artful aardvark,于 2017 年 10 月 19 日正式發布,是更換 gnome 的首個版本,但是這不是一個 lts 版本,會支持到 2018 年 8 月,是 2018 年 ubuntu 的 lts 的版本之前的過渡版本。openssh-server 的安裝基本上對于 ubuntu 的版本影響非常低,基本操作步驟大體一致。
安裝步驟
按照如下安裝步驟進行安裝
操作日志
此處再以安裝的狀態下抓取的日志,apt install 顯示會有所不同
devops@ubuntu:~$ sudo su
[sudo] password for devops:
root@ubuntu:/home/devops#
root@ubuntu:/home/devops# apt install openssh-server
reading package lists... done
building dependency tree
reading state information... done
openssh-server is already the newest version (1:7.5p1-10ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
root@ubuntu:/home/devops#
root@ubuntu:/home/devops# ssh -v
openssh_7.5p1 ubuntu-10ubuntu0.1, openssl 1.0.2g 1 mar 2016
root@ubuntu:/home/devops#
root@ubuntu:/home/devops# /etc/init.d/ssh status
● ssh.service - openbsd secure shell server
loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
active: active (running) since sat 2018-03-03 07:58:44 cst; 51min ago
process: 3072 execreload=/bin/kill -hup $mainpid (code=exited, status=0/success)
process: 3071 execreload=/usr/sbin/sshd -t (code=exited, status=0/success)
process: 3167 execstartpre=/usr/sbin/sshd -t (code=exited, status=0/success)
main pid: 3179 (sshd)
tasks: 1 (limit: 4915)
memory: 1.0m
cpu: 7ms
cgroup: /system.slice/ssh.service
└─3179 /usr/sbin/sshd -d
mar 03 07:58:44 ubuntu systemd[1]: starting openbsd secure shell server...
mar 03 07:58:44 ubuntu systemd[1]: started openbsd secure shell server.
mar 03 07:58:44 ubuntu sshd[3179]: server listening on 0.0.0.0 port 22.
mar 03 07:58:44 ubuntu sshd[3179]: server listening on :: port 22.
root@ubuntu:/home/devops#
root@ubuntu:/home/devops# /etc/init.d/ssh restart
[ ok ] restarting ssh (via systemctl): ssh.service.
root@ubuntu:/home/devops#
從終端進行 ssh 連接
liumiaocn:~ liumiao$ ssh devops@192.168.31.19
devops@192.168.31.19 s password:
welcome to ubuntu 17.10 (gnu/linux 4.13.0-21-generic x86_64)
* documentation: https://help.ubuntu.com
* management: https://landscape.canonical.com
* support: https://ubuntu.com/advantage
58 packages can be updated.
32 updates are security updates.
last login: sat mar 3 07:43:23 2018 from 192.168.31.242
devops@ubuntu:~$
到此,相信大家對“Ubuntu 下 openssh server 如何安裝和使用”有了更深的了解,不妨來實際操作一番吧!這里是丸趣 TV 網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
正文完