安装openssh-server,提供远程ssh

安装openssh-server,提供远程ssh

1.检查自己是否安装了openssh-server

复制代码
dpkg -l | grep ssh

如果输出内容有openssh-server,说明已经安装过了,可以跳过下一步

2.安装openssh-server

由于ubuntu自带ssh客户端,只需要安装openssh-server即可:

复制代码
sudo apt-get install openssh-server

3.安装完openssh-server后,启动ssh 服务

复制代码
sudo service ssh start

4.检查 ssh 服务是否启动成功

复制代码
sudo ps -e | grep ssh

5.如果有 sshd 则说明 ssh 服务已启动,如果没有启动,输入下边命令重新启动 ssh 服务

复制代码
sudo service ssh restart

6.如果openssh-server安装报错,出现依赖: openssh-client (= 1:8.2p1-4)

执行下面命令:

复制代码
sudo apt-get install openssh-client=1:8.2p1-4

安装完对应版本的openssh-clien后再执行:

复制代码
sudo apt-get install openssh-server

这是因为,openssh-server是依赖于openssh-clien的,ubuntu自带的openssh-clien与所要安装的openssh-server所依赖的版本不同,这里所依赖的版本是 1:8.2p1-4

所以要安装对应版本的openssh-clien,来覆盖掉ubuntu自带的。

相关推荐
wuicer2 小时前
ubuntu 20.04 安装anaconda以及安装spyder
linux·运维·ubuntu
wyiyiyi2 小时前
【Web后端】Django、flask及其场景——以构建系统原型为例
前端·数据库·后端·python·django·flask
天宇_任3 小时前
Mysql数据库迁移到GaussDB注意事项
数据库·mysql·gaussdb
小晶晶京京4 小时前
day34-LNMP详解
linux·运维·服务器
fengyehongWorld4 小时前
Linux crontab定时任务
linux·运维
碎像5 小时前
Linux上配置环境变量
linux·运维·服务器
xiep14383335105 小时前
Ubuntu 安装带证书的 etcd 集群
数据库·etcd
Java小白程序员6 小时前
Spring Framework:Java 开发的基石与 Spring 生态的起点
java·数据库·spring
sunflower_w7 小时前
linux I2C核心、总线与设备驱动
linux·运维·服务器
老虎06277 小时前
数据库基础—SQL语句总结及在开发时
数据库·sql·oracle