下了个Mini的Debian 8.3系统,精简了很多东西,连openssh-server都没有。

首先,添加源。

vi /etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 8.3.0 _Jessie_ – Official amd64 CD Binary-1 20160123-19:04]/ jessie main

默认是使用cd-rom,注释掉。

添加以下源,自带的超级慢,先添加一条就行了,因为还没不能ssh连接,不能够复制,一条条打上去得多累啊。

##163源

deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

##中科大源

deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie main contrib non-free
deb http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free

安装openssh-server,oepnssh-client默认已经安装好了

apt-get install oepnssh-server

编辑:

vi /etc/ssh/sshd_config

找到

PermitRootLogin without-password

修改为:

PermitRootLogin yes

就是允许root登陆,默认的规则虽然也允许root登陆,但是不能用密码登陆。

好了重启ssh服务

/etc/init.d/ssh restart

ssh 登陆进去,再把剩下的源复制进去,顺便安装个vim,自带的的vi太难用有bug。

如果觉得源的速度慢,可以安装个 apt-spy 自动测试生成最快的源列表。

apt-get install apt-spy


apt-spy -d unstable -a asia -t 5

命令行中的-d选项指定发行版本,如stable、testing、unstable。-a选项指定debian安装源服务器的区域,如asia、 Europe、North-America等。这些区域信息保存在/etc/apt-spy.conf文档中,如果要测试所有服务器,还可用ALL关健字代替具体的区域。-t选项指定连接超时阀值,阀值以秒为单位,设置较小的阀值能有效提高测试速度,忽略慢速服务器。