Ubuntu 下安装 OpenSSH Server 是无比轻松的一件事情,需要的命令只有一条:
sudo apt-get install openssh-server
(查看返回的结果,如果没有出错,则用putty、SecureCRT、SSH Secure Shell Client等SSH 客户端软件,输入您服务器的 IP 地址。如果一切正常的话,等一会儿就可以连接上了。并且使用现有的用户名和密码应该就可以登录了。)
然后确认sshserver是否启动了:(或用“netstat -tlp”命令)
ps -e | grep ssh
如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动了。
但在执行sudo apt-get install openssh-server出现Package has no installation candidate,解决方法如下:
#apt-get install
Reading package lists... Done
Building dependency tree... Done
Package aptitude 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 has no installation candidate
解决方法如下:
# sudoapt-get update
# sudo apt-get upgrade
# sudo apt-get install
这样就可以正常使用apt-get了~
今天在安装软件的时候出现了Package has no installation candidate的问题,如:
# apt-get install <packagename>
Reading package lists... Done
Building dependency tree... Done
Package aptitude 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 <packagename> has no installation candidate
解决方法如下:
# apt-get update
# apt-get upgrade
# apt-get install <packagename>
这样就可以正常使用apt-get了~
添加第三方地址:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update