手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

处理CentOS 5.5 x64 配置NFS服务过程中nfsnobody用户造成的问题

[日期:2012-05-29] 来源:Linux社区  作者:icedot [字体: ]

今天使用 CentOS5.5 64位的系统部署一个NFS服务器之后,使用客户端进行挂载,遇到了权限不足的问题,以下把我的排错过程和问题处理过程和各位分享。如果您在配置NFS服务器的过程中,遇到了同样的问题,希望这篇blog对您有所帮助。

环境:

NFS服务器IP:192.168.60.3   使用CentOS 5.5 x64操作系统

NFS客户端IP:192.168.60.4   使用CentOS 5.5 x64操作系统

 

NFS服务配置过程

1、查看确认一下,当前NFS服务器的NFS服务和RPC服务的状态

[root@NFS ~]# chkconfig --list |grep 3:on   (查看目前开机启动的服务)

crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
sysstat         0:off   1:off   2:on    3:on    4:off   5:on    6:off

[root@NFS ~]# /etc/init.d/portmap  status   (查看一下,portmap启动没有)
portmap is stopped

[root@NFS ~]# /etc/init.d/nfs  status       (查看一下,NFS启动没有)   

rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped

 

2、由于两个服务都没有启动,并且没有设置开机启动,所以我们进行一下配置

[root@NFS ~]# chkconfig nfs on             (设置NFS服务开机启动)
[root@NFS ~]# chkconfig portmap on         (设置portmap服务器开机启动)
[root@NFS ~]# chkconfig --list |grep 3:on  (确认一下修改生效了)

crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
nfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off
portmap         0:off   1:off   2:on    3:on    4:on    5:on    6:off

sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
sysstat         0:off   1:off   2:on    3:on    4:off   5:on    6:off  

 

3、我们重新启动一下服务器,确认一下上述修改都生效了,服务器启动正常。

[root@NFS ~]# shutdown -r now             (重启一下服务器)

[root@NFS ~]# /etc/init.d/portmap status  (确认一下portmap
portmap (pid 2316) is running...
[root@NFS ~]# /etc/init.d/nfs status   
rpc.mountd (pid 2434) is running...
nfsd (pid 2431 2430 2429 2428 2427 2426 2425 2424) is running...
rpc.rquotad (pid 2398) is running...
[root@NFS ~]# netstat -lnt                (查看一下RPC端口号是否正常)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State     
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:882                 0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:917                 0.0.0.0:*                   LISTEN     
tcp        0      0 0.0.0.0:7455                0.0.0.0:*                   LISTEN     
tcp        0      0 :::65534                    :::*                        LISTEN     


[root@NFS ~]# rpcinfo -p           (查看一下RPC注册的端口号)
   program vers proto   port
   
100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100011    1   udp    879  rquotad
    100011    2   udp    879  rquotad
    100011    1   tcp    882  rquotad
    100011    2   tcp    882  rquotad
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100021    1   udp  14392  nlockmgr
    100021    3   udp  14392  nlockmgr
    100021    4   udp  14392  nlockmgr
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100021    1   tcp   7455  nlockmgr
    100021    3   tcp   7455  nlockmgr
    100021    4   tcp   7455  nlockmgr
    100005    1   udp    914  mountd
    100005    1   tcp    917  mountd
    100005    2   udp    914  mountd
    100005    2   tcp    917  mountd
    100005    3   udp    914  mountd
    100005    3   tcp    917  mountd

[root@NFS ~]# mkdir /share       (新建一个目录用于NFS共享)
[root@NFS ~]# cd /               (回到根目录)
[root@NFS /]# ll                 (查看一下)
total 166
drwxr-xr-x  2 root root  4096 Mar 23 20:52 bin
drwxr-xr-x  4 root root  1024 Mar 23 18:18 boot
drwxr-xr-x 12 root root  4220 May 27 19:42 dev
drwxr-xr-x 84 root root  4096 May 27 20:15 etc
drwxr-xr-x  3 root root  4096 Mar 23 22:26 home
drwxr-xr-x 11 root root  4096 Mar 23 20:52 lib
drwxr-xr-x  7 root root 12288 Mar 23 20:52 lib64
drwx------  2 root root 16384 Mar 23 18:14 lost+found
drwxr-xr-x  2 root root  4096 Jan 27  2010 media
drwxr-xr-x  2 root root  4096 Mar 31  2010 misc
drwxr-xr-x  2 root root  4096 Jan 27  2010 mnt
drwxr-xr-x  2 root root  4096 Jan 27  2010 opt
dr-xr-xr-x 79 root root     0 May 27 19:41 proc
drwxr-x---  2 root root  4096 Mar 23 22:24 root
drwxr-xr-x  2 root root 12288 Mar 23 20:52 sbin
drwxr-xr-x  2 root root  4096 Mar 23 18:14 selinux
drwxr-xr-x  2 root root  4096 May 27 20:16 share
drwxr-xr-x  2 root root  4096 Jan 27  2010 srv
drwxr-xr-x 11 root root     0 May 27 19:41 sys
drwxrwxrwt  3 root root  4096 May 27 19:42 tmp
drwxr-xr-x 15 root root  4096 Mar 23 18:16 usr
drwxr-xr-x 20 root root  4096 Mar 23 18:17 var
[root@NFS /]# chown nfsnobody:nfsnobody share    (我们修改一下share的所有者和所属组)
[root@NFS /]# ll                  (确认一下所有者和所属组修改好了)
total 166
drwxr-xr-x  2 root      root       4096 Mar 23 20:52 bin
drwxr-xr-x  4 root      root       1024 Mar 23 18:18 boot
drwxr-xr-x 12 root      root       4220 May 27 19:42 dev
drwxr-xr-x 84 root      root       4096 May 27 20:33 etc
drwxr-xr-x  3 root      root       4096 Mar 23 22:26 home
drwxr-xr-x 11 root      root       4096 Mar 23 20:52 lib
drwxr-xr-x  7 root      root      12288 Mar 23 20:52 lib64
drwx------  2 root      root      16384 Mar 23 18:14 lost+found
drwxr-xr-x  2 root      root       4096 Jan 27  2010 media
drwxr-xr-x  2 root      root       4096 Mar 31  2010 misc
drwxr-xr-x  2 root      root       4096 Jan 27  2010 mnt
drwxr-xr-x  2 root      root       4096 Jan 27  2010 opt
dr-xr-xr-x 77 root      root          0 May 27 19:41 proc
drwxr-x---  2 root      root       4096 Mar 23 22:24 root
drwxr-xr-x  2 root      root      12288 Mar 23 20:52 sbin
drwxr-xr-x  2 root      root       4096 Mar 23 18:14 selinux
drwxr-xr-x  2 nfsnobody nfsnobody  4096 May 27 20:16 share
drwxr-xr-x  2 root      root       4096 Jan 27  2010 srv
drwxr-xr-x 11 root      root          0 May 27 19:41 sys
drwxrwxrwt  3 root      root       4096 May 27 19:42 tmp
drwxr-xr-x 15 root      root       4096 Mar 23 18:16 usr
drwxr-xr-x 20 root      root       4096 Mar 23 18:17 var
linux
相关资讯       CentOS教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款