先登录 :
man ssh-keygen
通过命令”ssh-keygen -t rsa“
生成之后会在用户的根目录生成一个 “.ssh”的文件夹
进入“.ssh”会生成以下几个文件
authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥
id_rsa : 生成的私钥文件
id_rsa.pub : 生成的公钥文件
know_hosts : 已知的主机公钥清单
如果希望ssh公钥生效需满足至少下面两个条件:
1) .ssh目录的权限必须是700
2) .ssh/authorized_keys文件权限必须是600
apt-get: Package has no installation candidate问题
今天在安装软件的时候出现了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了~
我这边报错了,Ubuntu Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)
E:Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)
E:Unable to lock the administration directory (/var/lib/dpkg/),are you root?
解决方案:
sudo rm -rf /var/lib/dpkg/lock
sudo rm -rf /var/cache/apt/archives/lock
sudo apt-get update
最后运行:sudo dpkg --configure -a 重新配置(系统会提醒) 。
打开"终端窗口",输入"sudo apt-get install openssh-server"-->回车-->输入"y"-->回车-->安装完成。
开心