linux公共目录设置,Linux nfs共享目录设置

Normal

0

7.8 磅

0

2

false

false

false

EN-US

ZH-CN

X-NONE服务器端设置

1、启动服务

service nfs

start

service

portmap start

2、修改配置文件

[root@SGmail_Backup

home]# tail /etc/exports

/home/backupdir

SGmail(rw)

[root@SGmail_Backup

home]#

[root@SGmail_Backup

home]# tail /etc/sysconfig/nfs

# Don't load

security modules in to the kernel

#SECURE_NFS_MODS="noload"

#

# Don't load

sunrpc module.

#RPCMTAB="noload"

#

MOUNTD_PORT="4002"

STATD_PORT="4003"

LOCKD_TCPPORT="4004"

LOCKD_UDPPORT="4004"

3、修改防火墙配置

[root@SGmail_Backup

home]# vi /etc/sysconfig/iptables

# Firewall

configuration written by system-config-securitylevel

# Manual

customization of this file is not recommended.

*filter

:INPUT ACCEPT

[0:0]

:FORWARD

ACCEPT [0:0]

:OUTPUT

ACCEPT [0:0]

:RH-Firewall-1-INPUT

- [0:0]

-A INPUT -j

RH-Firewall-1-INPUT

-A FORWARD -j

RH-Firewall-1-INPUT

-A

RH-Firewall-1-INPUT -i lo -j ACCEPT

-A

RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT

-A

RH-Firewall-1-INPUT -p 50 -j ACCEPT

-A

RH-Firewall-1-INPUT -p 51 -j ACCEPT

-A

RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT

-A

RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT

-A

RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4002:4004 -j

ACCEPT

-A

RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 4002:4004 -j

ACCEPT

4、导出目录

exportfs -rv

客户端:

1、启动服务

service nfs

start

service

portmap start

2、查看server相关信息

[root@SGmail

~]# rpcinfo -p SGmail_Backup

程序 版本 协议端口

1000002tcp111portmapper

1000002udp111portmapper

1000241udp942status

1000241tcp945status

1000111udp735rquotad

1000112udp735rquotad

1000111tcp738rquotad

1000112tcp738rquotad

1000032udp2049nfs

1000033udp2049nfs

1000034udp2049nfs

1000211udp4004nlockmgr

1000213udp4004nlockmgr

1000214udp4004nlockmgr

1000211tcp4004nlockmgr

1000213tcp4004nlockmgr

1000214tcp4004nlockmgr

1000032tcp2049nfs

1000033tcp2049nfs

1000034tcp2049nfs

1000051udp4002mountd

1000051tcp4002mountd

1000052udp4002mountd

1000052tcp4002mountd

1000053udp4002mountd

1000053tcp4002mountd

[root@SGmail ~]# showmount -e SGmail_Backup

Export list for SGmail_Backup:

/home/backupdir SGmail

3、挂载文件系统

mount -t nfs SGmail_Backup:/home/backupdir

/mailbak

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值