KaliLinux系统重新更正主机名以及修改⽤⽤户密码教程:注:root@kali格式,⼀般root是指配置⽤户名,kali是指配置主机名,排列顺序为⽤户名在前,主机名在后!
linux修改口令的命令修改Hostname属性:
root@kali:~# leafpad /etc/hostname
图⽚发⾃简书App
修改Hosts属性:
root@kali:~# leafpad /etc/hosts
图⽚发⾃简书App 注:保存⽂件后执⾏重启命令!
root@kali:~# reboot
图⽚发⾃简书App
图⽚发⾃简书App 重新加载配置⽂件:sqlserver自动生成er图
root@kali:~# service hostname.sh start
root@kali:~# service networking force-reload
root@kali:~# service network-manager force-reload
图⽚发⾃简书App
图⽚发⾃简书App ⽹络⽆法连接:
图⽚发⾃简书App
图⽚发⾃简书App
图⽚发⾃简书App 修改Bash脚本:
root@kali:~# touch newhostname
表单编号制定规则root@kali:~# leafpad newhostname
图⽚发⾃简书App 修改配置⽂件:
#!/bin/bash
cp -n /etc/hosts{,.old}
idomainname=$(domainname -i)
fdomainname=$(domainname -f)
newhn=$(cat /dev/urandom | tr -dc 'A-Z' | head -c8)
echo $newhn > /etc/hostname
mv /etc/hosts /etc/hosts.old
echo "127.0.0.1 localhost" > /etc/hosts
echo "$idomainname $fdomainname $newhn" >> /etc/hosts
echo "# The following lines are desirable for IPv6 capable hosts" >> /etc/hosts echo "::1 localhost ip6-localhost ip6-loopback" >> /etc/hosts
echo "ff02::1 ip6-allnodes" >> /etc/hosts
grep 上下文echo "ff02::2 ip6-allrouters" >> /etc/hosts
service hostname.sh stop
sleep 1
service hostname.sh start
service networking stop
sleep 1
service networking start
service network-manager stop
sleep 1
service network-manager start
cat函数matlabxhost +$newhn
exit
注:Leafpad编辑器保存并退出!
移动Bash脚本到/usr/bin/ folder:
root@kali:~# mv newhostname /usr/bin/newhostname
赋予权限:
root@kali:~# chmod +x /usr/bin/newhostname
linux图片
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论