ubuntu安装sshd服务

昨天在服务器中安装了ubuntu 10.04,装好基本系统后,在安装openssh中,使用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

 

解决办法:

首先得试一下是否能PING通外网,然后用sudo apt-get update 确认一下,的确是因为网络不通。所以接下来得要重新设置网卡。

由于在机房都是设置静态IP,所以需要做如下操作:

1)用ifconfig,查看网卡情况,确定网卡名称。这里假如是eth0.

2)为网卡配置静态IP地址

  编辑文档/etc/network/interfaces:  sudo vi /etc/network/interfaces  并用下面的行来替换有关eth0的行:   # The primary network interface  auto eth0  iface eth0 inet static  address 192.168.3.90  gateway 192.168.3.1  netmask 255.255.255.0  network 192.168.3.0 (可以不用)  broadcast 192.168.3.255 (可以不用)  将上面的ip地址等信息换成您自己就能够了. 然后输入"wq " 回车,以保存并退出Vi。3)最后用下面的命令使网络配置生效:  sudo /etc/init.d/networking restart

于是,我把网卡的IP地址,和DNS设置好并重启。

再使用sudo apt-get update ,OK 问题解决!

然后,使用sudo apt-get install openssh-server   就可以安装了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值