Ubuntuubuntu 16.04 安装sshh服务器端,不成功,为什么

您所在的位置: &
ubuntu下如何安装使用SSH?
ubuntu下如何安装使用SSH?
ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
xjj@xjj-desktop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:
-desktop:~$ sudo apt-get install openssh-server&&
xjj@xjj-desktop:~$ sudo apt-get install openssh-server
系统将自动进行安装,安装完成以后,先启动服务:
@xjj-desktop:~$ sudo /etc/init.d/ssh start&&
xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start
启动后,可以通过如下命令查看服务是否正确启动
@xjj-desktop:~$ ps -e|grep ssh &&
6212 ?&&&&&&&&00:00:00 sshd&&
xjj@xjj-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd
如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config &&
# Package generated configuration file &&
# See the sshd(8) manpage for details &&
# What ports, IPs and protocols we listen for&&
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
最后,应该是连接的时候了。请看如下命令:
xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129&&
xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config
希望本文介绍的ubuntu下安装使用SSH的方法能够对读者有所帮助,更多还有待于读者去探索和学习。【编辑推荐】【责任编辑: TEL:(010)】
关于&&的更多文章
生活中,我们总是追求各种方便,因此我们会总结出各种“常用”来
网友评论TOP5
本专题汇总了2012上半年的《Linux运维趋势》电子杂志
北京时间7月25日消息,苹果推出了Mac OS X 10.8(美洲
本书描述了怎样应用面向对象的概念来进行.NET应用程序的架构、设计和开发。作者将重点放在了面向业务的对象,即业务对象和怎样在
51CTO旗下网站(vmware)Ubuntu中SSh的安装
&&(1)&&在emule下载vmware
&&&&[虚拟工作站].VMware-workstation-7-english.rar
&&&&[虚拟工作站].VMware-workstation-7-keygen.rar
&&&&VMware-workstation-7-.7.0.203739.汉化补丁.rar
&&(&但是好像这个版本的&快照&功能有点问题)
&&(2) 在vmware中安装Ubuntu
&(3)在同学的机器上安装的是[Ubuntu].ubuntu-7.10-desktop-i386.iso版本的,一直找不到openssh-server的源。上网找了很多的源,改/etc/apt/sources.list依旧于事无补(感觉不是很好用),有点想发飙~~会自己电脑,新安装一个版本8.04的,直接使用命令:
&&&sudo apt-get install openssh-server
就直接搞定了。&&&
Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。
然后确认sshserver是否启动了:
ps -e |grep ssh
如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动了。
[ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。然后重启SSH服务。
]ssh连接:ssh winse@192.168.193.132
<font color="#. 首先在服务器上安装ssh的服务器端。
sudo apt-get install openssh-server($ sudo aptitude install openssh-server)2. 启动ssh-server(重启SSH服务)。$ /etc/init.d/ssh restart3. 确认ssh-server已经正常工作。$ netstat -tlp
看到上面ssh行输出说明ssh-server已经在运行了。4. 在客户端通过ssh登录服务器。假设服务器的IP地址是192.168.0.103,登录的用户名是hyx。$ ssh -l hyx 192.168.193.132接下来会提示输入密码,然后就能成功登录到服务器上了
(4)&如果使用apt-get下载不到openssh-server,可以更新/etc/sources.list文件
sudo apt-get update
sources.list(Ubuntu 8.04.1)文件内容:
# deb cdrom:[Ubuntu 8.04.1 _Hardy Heron_ - Release i386 ()]/ hardy main restricted# See /community/UpgradeNotes for how to upgrade to# newer versions of the distribution.
deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 ()]/ gutsy main restricteddeb http://us./ubuntu/ hardy main restricteddeb-src http://us./ubuntu/ hardy main restricted
## Major bug fix updates produced after the final release of the## distribution.deb http://us./ubuntu/ hardy-updates main restricteddeb-src http://us./ubuntu/ hardy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## universe WILL NOT receive any review or updates from the Ubuntu security## team.deb http://us./ubuntu/ hardy universedeb-src http://us./ubuntu/ hardy universedeb http://us./ubuntu/ hardy-updates universedeb-src http://us./ubuntu/ hardy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://us./ubuntu/ hardy multiversedeb-src http://us./ubuntu/ hardy multiversedeb http://us./ubuntu/ hardy-updates multiversedeb-src http://us./ubuntu/ hardy-updates multiverse
## Uncomment the following two lines to add software from the 'backports'## repository.## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://us./ubuntu/ hardy-backports main restricted universe multiverse# deb-src http://us./ubuntu/ hardy-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's## 'partner' repository. This software is not part of Ubuntu, but is## offered by Canonical and the respective vendors as a service to Ubuntu## users.# deb /ubuntu hardy partner# deb-src /ubuntu hardy partner
deb /ubuntu hardy-security main restricteddeb-src /ubuntu hardy-security main restricteddeb /ubuntu hardy-security universedeb-src /ubuntu hardy-security universedeb /ubuntu hardy-security multiversedeb-src /ubuntu hardy-security multiverse
&sources.list(Ubuntu 9.10 )文件内容:&
#deb cdrom:[Ubuntu 9.10 _Karmic Koala_ - Release i386 ()]/ karmic main restricted# See /community/UpgradeNotes for how to upgrade to# newer versions of the distribution.
deb http://us./ubuntu/ karmic main restricteddeb-src http://us./ubuntu/ karmic main restricted
## Major bug fix updates produced after the final release of the## distribution.deb http://us./ubuntu/ karmic-updates main restricteddeb-src http://us./ubuntu/ karmic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb http://us./ubuntu/ karmic universedeb-src http://us./ubuntu/ karmic universedeb http://us./ubuntu/ karmic-updates universedeb-src http://us./ubuntu/ karmic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://us./ubuntu/ karmic multiversedeb-src http://us./ubuntu/ karmic multiversedeb http://us./ubuntu/ karmic-updates multiversedeb-src http://us./ubuntu/ karmic-updates multiverse
## Uncomment the following two lines to add software from the 'backports'## repository.## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://us./ubuntu/ karmic-backports main restricted universe multiverse# deb-src http://us./ubuntu/ karmic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's## 'partner' repository.## This software is not part of Ubuntu, but is offered by Canonical and the## respective vendors as a service to Ubuntu users.# deb /ubuntu karmic partner# deb-src /ubuntu karmic partner
deb /ubuntu karmic-security main restricteddeb-src /ubuntu karmic-security main restricteddeb /ubuntu karmic-security universedeb-src /ubuntu karmic-security universedeb /ubuntu karmic-security multiversedeb-src /ubuntu karmic-security multiverse
&&最后修改于
请各位遵纪守法并注意语言文明Linux(2)
以前一直用centos,公司现在有一台服务器ubuntu的,我也懒得换centos(最主要的是,我不会换,我只知道拿来用)
我现在要用这台机器作为内网服务器,使得我的同事能通过SSH连接上去,通过SSH配置满足自己需求的环境
首先,通过修改Ubuntu的网络配置文件进行网络配置,如下:
vi /etc/network/interfaces
默认内容如下:
iface lo inet loopback
因为是开发需求,所以咱们就固定此IP
#auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.215
255.255.255.0
192.168.1.1
dns-nameservers 61.132.163.68 202.102.213.68
网络上有很多说法,将最后一行的dns服务器设置放置在/etc/resolv.conf
namserver 61.132.163.68 202.102.213.68
但是,机器一重启,resolv.conf中的设置就被清空了
重启网卡,即可上网了
/etc/init.d/networking restart
联网的问题解决了,那么现在就是要用ssh来连接到这个server
按照网上大部分的说法:
# sudo apt-get install openssh-server
出现以下问题:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package openssh-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package openssh-server has no installation candidate
经过很长时间的摸索,发现是Ubuntu的软件源问题
查看Ubuntu的版本
cat /etc/issue
Ubuntu 13.10
在网上找该版本的源
vi /etc/apt/sources.list
把找到的源复制过去
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openssh-server
最后才真正的解决这个问题
参考资料:
&#65279;&#65279;
&#65279;&#65279;
&#65279;&#65279;
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:40561次
排名:千里之外
原创:26篇
转载:27篇
(3)(2)(5)(3)(9)(3)(2)(2)(2)(1)(1)(9)(11)

我要回帖

更多关于 ubuntu 14.04 安装ssh 的文章

 

随机推荐