首页 > 系统服务 > 详细

linux 添加ssh和开启ssh服务apt管理的ubuntu

时间:2019-04-13 15:43:08      阅读:451      评论:0      收藏:0      [点我收藏+]

是在ubuntu下出现的需求 现笔记记录

apt-get  update

更新源命令

apt-get  install  openssh-server

安装ssh服务

容易出现无法定位软件包。出现此问题是因为软件源没有更新 可以尝试更新命令一试。或编辑etc/apt/source.list或sources.list ,添加源地址

如:

阿里云Ubuntu 18.04源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

还可以百度一下,查找源

然后apt-get  update

更新

ps -e  |  grep  ssh

检测ssh服务是否启动

 看到有ssh字样就是启动了

技术分享图片

如未启动就要手动启动服务

/etc/init.d/ssh start
直接find查找ssh找到路径,或到etc下手动搜索
配置ssh-server,配置文件位于/etc/ssh/sshd_config,默认端口为22,为了安全,一般自定义为其他端口,然后重启

/etc/init.d/ssh resart
然后用xshll或putty连接

linux 添加ssh和开启ssh服务apt管理的ubuntu

原文:https://www.cnblogs.com/kesz/p/10701266.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!