2、更新Ubuntu的镜像源
##ubuntu
//方法一、network命令
# service network restart
或者
/etc/init.d/networking restart
//方法二、ifdown/ifup命令
# ifdown eth0 关闭
# ifup eth0 开启
//方法三、ifconfig命令
# ifconfig eth0 down 关闭
# ifconfig eth0 up 开启
1 新用户登录后 使用sudo passwd root 更改root密码
(1)需要查看Ubuntu的版本号 lsb_release -a
(2)镜像文件 /etc/apt/sources.list
阿里镜像地址 https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.12c21b11n6tMgJ
ubuntu 18.04(bionic)
ubuntu 20.04(focal)
(4) apt-get update 更新源
不能直接修改 vim /etc/resolv.conf
永久修改root密码
sudo passwd root
PermitRootLogin prohibit-password 允许root秘钥远程登录,但是禁止root远程密码登录
PermitRootLogin yes 允许root远程登录,密码秘钥皆可
PasswordAuthentication yes 允许ssh密码登录权限
打开ssh的配置文件 vi /etc/ssh/sshd_config
PermitRootLogin without-password 默认注释,在这行下添加
PermitRootLogin yes
PasswordAuthentication yes 修改成yes
重启ssh服务
添加Ubuntu的镜像源
lsb_release -a
查看系统的版本
根据阿里云的镜像地址
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.12c21b11nziP2u
apt install openssh-server
systemctl status ssh
1 新用户登录后 使用sudo passwd root 更改root密码
直接使用root登录
34行
#PermitRootLogin prohibit-password PermitRootLogin yes
2、更新Ubuntu的镜像源
(1)需要查看Ubuntu的版本号 lsb_release -a
(2)镜像文件 vi /etc/apt/sources.list
阿里镜像地址 https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.12c21b11n6tMgJ
ubuntu 18.04(bionic)
ubuntu 20.04(focal)
(4) apt-get update 更新源
关闭防火墙
ufw disable
防火墙在系统启动时自动禁用
设置DNS
不能直接修改 vim /etc/resolv.conf
一、网卡地址配置
Ubuntu的网络配置文件是:/etc/network/interfaces
1、以DHCP 方式配置网卡
auto eth0
iface eth0 inet dhcp
用sudo /etc/init.d/networking restart命令使网络设置生效
2、为网卡配置静态IP地址
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
3、设定第二个IP地址(虚拟IP地址)
sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
4、设置主机名称(hostname)
使用下面的命令来查看当前主机的主机名称:
sudo /bin/hostname
使用下面的命令来设置当前的主机名称:
sudo /bin/hostname newname
5、配置DNS
(1) /etc/hosts中加入一些主机名称和这些主机名称对应的IP地址,这是本机的静态查询
(2) /etc/resolv.conf
nameserver *.*.*.*
简单下载包
apt install -y tree nmap sysstat lrzsz telnet vim lsof net-tools rsync ntpdate unzip wget
apt install update:将远程软件库和本地软件库做对比,检查哪些软件可以更新,以及软件包依赖关系,给出一个分析报告。只检查不更新。
apt install full-upgrade:在执行full-upgrade 之前也要先执行update ,升级整个系统,必要时可以移除旧软件包
apt install dist-upgrade:
在执行dist-upgrade 之前也要先执行update ,dist-upgrade 包含upgrade,同时增添了以下功能:
可以智能处理新软件包的依赖
智能冲突解决系统
安装新软件包时,可以移除旧软件包,但不是所有软件都可以。
KALI系统
阿里云,清华大学镜像下载地址
https://mirrors.aliyun.com/kali-images/?spm=a2c6h.13651104.0.0.43d2506fbswN9x
https://mirrors.tuna.tsinghua.edu.cn/kali-images/
工具源地址
# cat /etc/apt/sources.list
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
apt-get update
# 更新软件包的列表
ssh 端口调整 root登录 秘钥登录 等等
networking IP 端口调整
DNS 调整
防火墙 调试