AIX5.3中的sar命令不可用,提示:sar: The file access permissions do not allow the specified action.
我们使用truss sar 1 1进行跟踪。发现access("/usr/lib/sa/sadc", 01) Err#13 EACCES,查看权限为
% ls -al /usr/lib/sa/sadc
-r-sr-x--- 1 root adm 16170 Apr 27 2006 /usr/lib/sa/sadc
则要使用其他用户能访问sar则应满足1,adm组用户;2,给sadc加上其他用户x权限。两者必选一,为安全方面考虑,建议是将该用户加入到adm组中,编辑/etc/group,把该用户加入到adm组中,该用户即可执行sar.
% sar -d 2 3
sar: The file access permissions do not allow the specified action.
% truss sar 1 1
execve("/usr/bin/sar", 0x2FF22D04, 0x2FF22D14) argc: 3
sbrk(0x00000000) = 0x20003A88
vmgetinfo(0x2FF21580, 7, 16) = 0
sbrk(0x00000000) = 0x20003A88
sbrk(0x00000008) = 0x20003A88
__libc_sbrk(0x00000000) = 0x20003A90
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
__loadx(0x01000180, 0x2FF21040, 0x00000960, 0xF0428DC4, 0xF0428CF4) = 0xF0282438
__loadx(0x07080000, 0xF0428D94, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF0283368
__loadx(0x07080000, 0xF0428CD4, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF0283374
__loadx(0x07080000, 0xF0428DA4, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF02833A4
__loadx(0x07080000, 0xF0428CE4, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF02833B0
__loadx(0x07080000, 0xF0428D64, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF0283380
__loadx(0x07080000, 0xF0428D04, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF0283398
__loadx(0x07080000, 0xF0428D74, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF02833BC
__loadx(0x07080000, 0xF0428D84, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF02833EC
__loadx(0x07080000, 0xF0428D14, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF02833D4
__loadx(0x07080000, 0xF0428D24, 0xFFFFFFFF, 0xF0282438, 0x00000000) = 0xF0283470
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
getuidx(4) = 500
getuidx(2) = 500
getuidx(1) = 500
getgidx(4) = 101
getgidx(2) = 101
getgidx(1) = 101
__loadx(0x01000080, 0x2FF21040, 0x00000960, 0x2FF21AC0, 0x00000000) = 0xD0149130
access("/usr/lib/nls/msg/en_US/sar.cat", 0) = 0
_getpid() = 147786
access("/usr/lib/sa/sadc", 01) Err#13 EACCES
access("/usr/lib/nls/msg/en_US/libc.cat", 0) = 0
_getpid() = 147786
open("/usr/lib/nls/msg/en_US/libc.cat", O_RDONLY) = 3
kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kfcntl(3, F_SETFD, 0x00000001) = 0
kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kread(3, "\0\001 ù\007\007 I S O 8".., 4096) = 4096
lseek(3, 0, 1) = 4096
lseek(3, 0, 1) = 4096
lseek(3, 0, 1) = 4096
_getpid() = 147786
lseek(3, 0, 1) = 4096
close(3) = 0
sarkwrite(2, " s a r", 3) = 3
: kwrite(2, " : ", 2) = 2
The file access permissions do not allow the specified action.kwrite(2, " T h e f i l e a c c".., 62) = 62
kwrite(2, "\n", 1) = 1
kfcntl(1, F_GETFL, 0x2FF22FFC) = 2
kfcntl(2, F_GETFL, 0x00000000) = 2
_exit(1)
阅读(1369) | 评论(0) | 转发(0) |