先确定网络链接没有问题,ping一下百度看能不能ping通,如果可以接下来的步骤再操作,否则先排除网络故障。
ping www.baidu.com
新建root账户:(根据提示设置密码)
sudo passwd root
修改源文件gedit /etc/apt/sources.list :将源文件的所有东西全部删掉,替换为下面的内容(其实就是一个阿里源,也可以替换为清华源等等)
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更新安装包:
sudo apt update&& apt upgrade
安装vim编辑器:
sudo apt install vim
安装ftp服务:
sudo apt-get install vsftpd
安装nfs服务:
sudo apt-get install nfs-kernel-server
重启nfs服务:
sudo service nfs-kernel-server restart
安装ssh-server:
sudo apt-get install openssh-server
编辑配置文件:
sudo vim /etc/ssh/sshd_config
文件中找到#PermitRootLogin without-password,将#去掉,without-password改为yes
退出并保存,重启ssh:
sudo service sshd restart
查看并记住IP:
ifconfig
推荐使用MobaXterm远程连接你就可以再windos下操作你的linux了。
嫌弃上述步骤繁琐,可以将下面的文件夹放到linux,使用指令运行脚本就可以了。https://download.csdn.net/download/qq_28116937/20814499