0


centos、debian、kylinsec(麒麟)虚拟机更改ip地址、主机名


一、ssh连接速度慢

1.查找原因:ssh -v 192.168.32.1 进行debug,打印的信息就可以看到连接到什么地方被耽搁了。

2.检测连接时间:time ssh root@192.168.100.10 exit

3.解决方法:

(1)关闭DNS反向解析
在linux中,默认就是开启了SSH的反向DNS解析,这个会消耗大量时间,因此需要关闭。

vi /etc/ssh/sshd_config
UseDNS=no

(2)关闭SERVER上的GSS认证
在authentication gssapi-with-mic有很大的可能出现问题,因此关闭GSS认证可以提高ssh连接速度。

vi /etc/ssh/sshd_config
GSSAPIAuthentication no

(3) 修改server上nsswitch.conf文件

vi /etc/nsswitch.conf
找到
hosts: files dns
改为
hosts:files

(4)执行service sshd restart

二、debian虚拟机

1.debian修改ip地址

首先以root权限打开/etc/network/interfaces

#删除 allow-htplug enp0s3 行,修改 dhcp 参数为 static。下面是我的示例文件,根据您的环境更改接口名称和 ip 详细信息。

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet static
address 192.168.1.183
netmask 255.255.255.0
gateway 192.168.1.1
broadcase 192.168.1.255
dns-nameservers 8.8.8.8

举例:

2.debian修改hostname(主机名)

//1.修改/etc/hostname文件里的主机名
vim /etc/hostname

//2.修改/etc/hosts文件里的主机名
vim /etc/hosts

举例:

3.debian新建用户和密码

1.新建用户user

adduser user

2.设置密码

passwd user

设置完密码就可以登录了

三、kylinsec(麒麟)虚拟机

1.kylin修改ip

第一步:

第二步:

第三步:

第四步:

四、centos

1.修改静态ip

(10条消息) centos7虚拟机静态ip设置详细教程(超全超详细亲测有效)_centos7 配置静态ip_smilehjl的博客-CSDN博客

标签: debian tcp/ip linux

本文转载自: https://blog.csdn.net/xiao_12312/article/details/129121331
版权归原作者 大豆先生 所有, 如有侵权,请联系我们删除。

“centos、debian、kylinsec(麒麟)虚拟机更改ip地址、主机名”的评论:

还没有评论