本篇内容主要讲解“Ubuntu下openssh server如何安装和使用”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Ubuntu下openssh server如何安装和使用”吧!
事前准备
ubuntu版本:17.10 devops@ubuntu:~$ cat /etc/issue ubuntu 17.10 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:~$