自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

linux下修改IP、DNS、路由命令行設(shè)置

系統(tǒng) Linux
現(xiàn)有連接自己不會(huì)斷,因?yàn)閗ill -HUP `cat /var/run/sshd.pid` 只是HUP監(jiān)聽(tīng)的那個(gè),已經(jīng)建立的連接(不同的 pid)不會(huì)斷。

ubuntu 版本命令行設(shè)置IP

cat /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 192.168.1.104

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.2

# dns-* options are implemented by the resolvconf package, if installed

dns-nameservers 58.22.96.66 218.104.128.106 202.101.138.8

dns-search .COM

重啟網(wǎng)卡: /etc/init.d/networking restatr

redhat linux版本命令行設(shè)置IP:

ifconfig eth0 新ip

然后編輯/etc/sysconfig/network-scripts/ifcfg-eth0,修改ip

一、修改IP地址

[aeolus@db network-scripts]$ vi ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=219.136.241.211

NETMASK=255.255.255.128

GATEWAY=219.136.241.254

二、修改網(wǎng)關(guān)

vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=Aaron

GATEWAY=192.168.1.1

三、修改DNS

[aeolus@db etc]$ vi resolv.conf

nameserver 202.96.128.68

nameserver 219.136.241.206

四、重新啟動(dòng)網(wǎng)絡(luò)配置

/etc/init.d/network restart

五、例子

1、修改ip地址

即時(shí)生效:

# ifconfig eth0 192.168.0.20 netmask 255.255.255.0

啟動(dòng)生效:

修改/etc/sysconfig/network-scripts/ifcfg-eth0

#p#

2、修改default gateway

即時(shí)生效:

# route add default gw 192.168.0.254

啟動(dòng)生效:

修改/etc/sysconfig/network-scripts/ifcfg-eth0

修改dns

修改/etc/resolv.conf

修改后可即時(shí)生效,啟動(dòng)同樣有效

3、修改host name

即時(shí)生效:

# hostname fc2

啟動(dòng)生效:

修改/etc/sysconfig/network

ps:

DEVICE=eth0

BOOTPROTO=static

IPADDR=192.168.8.85

NETMASK=255.255.248.0

GATEWAY=192.168.8.1

HWADDR=00:0uu3:47:2C:D5:40

ONBOOT=yes

4:添加linux系統(tǒng)啟動(dòng)項(xiàng):

vi /etc/rc.d/rc.local

修改Linux系統(tǒng)SSH的端口號(hào)

修改Linux系統(tǒng)SSH的端口號(hào) 操作系統(tǒng)linux和Unix都適用: 修改配置文件 /etc/ssh/sshd_config,將里面的Port改為新端口(此端口必須是沒(méi)有程序用到),比如10022, 然后

kill -HUP `cat /var/run/sshd.pid` 就行了。 注:現(xiàn)有連接自己不會(huì)斷,因?yàn)閗ill -HUP `

修改Linux系統(tǒng)SSH的端口號(hào)

操作系統(tǒng)linux和Unix都適用:

修改配置文件 /etc/ssh/sshd_config,將里面的Port改為新端口(此端口必須是沒(méi)有程序用到),比如10022,

然后 kill -HUP `cat /var/run/sshd.pid` 就行了。

注:現(xiàn)有連接自己不會(huì)斷,因?yàn)閗ill -HUP `cat /var/run/sshd.pid` 只是HUP監(jiān)聽(tīng)的那個(gè),已經(jīng)建立的連接(不同的 pid)不會(huì)斷。

要想重新啟用并用新端口登陸 ,此時(shí)可以在本登陸帳戶下 用 exit 命令退出,在用新的端口登陸即可!

【編輯推薦】

  1. Linux命令行修改IP、網(wǎng)關(guān)、DNS的方法
  2. 如何在Linux上建立DNS服務(wù)器
  3. linux下智能DNS配置過(guò)程
責(zé)任編輯:趙寧寧 來(lái)源: chinaitlab
相關(guān)推薦

2009-08-11 10:10:05

Linux命令行修改ILinux命令行Linux命令

2009-08-11 10:16:08

linux命令行修改Ired hat linlinux命令行參數(shù)

2010-01-13 15:15:16

Linux路由

2017-08-29 15:15:40

Linux命令公網(wǎng)IP

2009-12-09 09:25:52

Linux命令行svn命令

2009-08-11 10:20:52

linux命令行修改Ilinux命令行linux命令行參數(shù)

2010-06-01 19:14:53

SVN命令行

2009-08-06 20:14:16

linux命令行模式linux命令行修改系統(tǒng)時(shí)間

2009-08-11 09:58:22

Linux命令行Linux命令svn命令

2019-12-10 10:03:18

Linux命令行工具

2022-10-14 19:30:29

Linux

2019-05-21 10:38:17

Linux命令行

2014-05-04 10:58:18

Linux命令行Linux發(fā)行版

2018-05-15 08:40:40

Linux命令數(shù)學(xué)運(yùn)算

2009-08-11 09:11:06

linux打開(kāi)瀏覽器命linux命令行瀏覽器linux命令行

2009-08-17 07:43:42

Linux命令行安裝字linux命令行安裝彩色字體設(shè)置

2022-10-13 19:23:21

Linux命令行IP 地址

2010-10-12 17:01:21

MySQL命令行

2020-03-30 12:57:50

Linux命令行Markdown

2009-12-24 14:51:39

Linux命令行
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)