ubuntu:安装/启动ssh(23.10)

发布时间 2023-11-14 08:23:35作者: 刘宏缔的架构森林

一,ubuntu23.10默认未安装ssh

如下:

liuhongdi@lhdpc:~$ service ssh status
Unit ssh.service could not be found.

二,安装ssh

1,从命令行安装

root@lhdpc:~# apt-get install ssh

2,安装完成后查看效果:

root@lhdpc:~# service ssh status 
○ ssh.service - OpenBSD Secure Shell server 
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; preset: enabled) 
    Drop-In: /etc/systemd/system/ssh.service.d 
             └─00-socket.conf 
     Active: inactive (dead) 
TriggeredBy: ● ssh.socket 
       Docs: man:sshd(8) 
             man:sshd_config(5)

3,启动服务:

root@lhdpc:~# service ssh start

服务启动后查看效果,可见已启动

root@lhdpc:~# service ssh status
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; preset: enabled)
    Drop-In: /etc/systemd/system/ssh.service.d
             └─00-socket.conf
     Active: active (running) since Fri 2023-11-10 19:00:14 CST; 3s ago
TriggeredBy: ● ssh.socket
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 7904 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 7905 (sshd)
      Tasks: 1 (limit: 4519)
     Memory: 1.3M
        CPU: 31ms
     CGroup: /system.slice/ssh.service
             └─7905 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
11月 10 19:00:14 lhdpc systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...
11月 10 19:00:14 lhdpc sshd[7905]: Server listening on :: port 22.
11月 10 19:00:14 lhdpc systemd[1]: Started ssh.service - OpenBSD Secure Shell server.

如图:

说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/11/10/ubuntu-an-zhuang-qi-dong-ssh-23-10/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com

三,查看ubuntu的版本:

root@lhdpc:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic