Operating System - HP-UX
1846551 Members
1716 Online
110256 Solutions
New Discussion

ls command gets unreadable error

 
Achilles_2
Regular Advisor

ls command gets unreadable error

Hi there,

I have encountered an funny problem. The case is when I use "ls /opt" command with a normal user it returns "/opt unreadable", but if I use "ls /opt/dce" by the same user the output is correct. Also if I use "ls /opt" by root the output is correct. This sitution also exists in some command which shows as below. I check the /opt is existing, how come "ls" not worked properly?

user1@server: /opt # echo *
*
user1@server: /home/user1 # ls /opt
/opt unreadable
user1@server: /home/user1 # cd /opt
user1@server: /opt # ls -rlt
. unreadable
total 16
user1@server: /home/user1 # cd /opt/dce
user1@server: /opt/dce # ls
bin dcecp examples include lbin lib newconfig sbin share tcl
user1@server: /opt # pwd
ksh: pwd: permission denied
user1@server: /opt # ls
. unreadable
user1@server: /opt # ls /opt
/opt unreadable
user1@server: /opt # pwd
ksh: pwd: permission denied
user1@server: /opt # cd
user1@server: /home/user1 # ls /opt
/opt unreadable
user1@server: /home/user1 # bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 178904 25752 87% /
/dev/vg00/lvol1 311296 99584 210112 32% /stand
/dev/vg00/lvol8 2613248 1466704 1137688 56% /var
/dev/vg00/lvol7 2457600 2352904 104128 96% /usr
/dev/vg00/lvol4 204800 20208 183216 10% /tmp
/dev/vg00/lvol6 7340032 3825632 3488736 52% /opt
/dev/vg00/lvol5 2048000 1065152 980936 52% /home
user1@server: /home/user1 # uname -a
HP-UX server B.11.23 U ia64 0253301370 unlimited-user license
user1@server: /home/user1 # uname
HP-UX
user1@server: /home/user1 # pwd
/home/user1
user1@server: /home/user1 # cd /opt
user1@server: /opt # pwd
ksh: pwd: permission denied

Thanks in advance.
11 REPLIES 11
Ivan Krastev
Honored Contributor

Re: ls command gets unreadable error

Check permitions on /opt .

dr-xr-xr-x 46 bin bin 1024 Aug 17 18:12 opt



regards,
ivan
Peter Godron
Honored Contributor

Re: ls command gets unreadable error

Hi,
you probably have permission 711 rather than 755 on /opt.
ll / | grep opt

Change with:
chmod 755 /opt
Achilles_2
Regular Advisor

Re: ls command gets unreadable error

Thanks for your suggestion, the permissions in the directory are correct.
i'm sure there are files in the the directory root read every file

Besides I use /usr/bin/ls and /sbin/ls, the output gets ". reachable"! It is the same output as "ls".

Achilles_2
Regular Advisor

Re: ls command gets unreadable error

The permission right of /opt is 755 now
Bill Hassell
Honored Contributor

Re: ls command gets unreadable error

What is the permission for /? Did someone withg root privileges set an ACL?

ll -d / /opt
getacl / /opt


Bill Hassell, sysadmin
Achilles_2
Regular Advisor

Re: ls command gets unreadable error

Here is the output:

user1@server:/ # ll -d / /opt
drwxr-xr-x 19 root root 8192 Oct 27 19:35 //
dr-x--x--x 53 bin bin 8192 Aug 8 2005 /opt/

user1@server:/ # getacl / /opt
# file: /
# owner: root
# group: root
user::rwx
group::r-x
class:r-x
other:r-x

# file: /opt
# owner: bin
# group: bin
user::r-x
group::--x
class:--x
other:--x
Henk Geurts
Esteemed Contributor

Re: ls command gets unreadable error

hi Achilles;

it should read something like :

ll -d /opt
dr-xr-xr-x 54 bin bin 2048 Sep 13 01:17 /opt

just do as root-user:
cd /
chmod 755 /opt

and you will be oke
Bill Hassell
Honored Contributor

Re: ls command gets unreadable error

As mentioned, someone logged in as root changed the permissions on /opt, removing read permissions to the directory. And that is what is giving you the strange symptoms. Since /opt has been changed, I would recommend running:

swverify \*

to check the rest of the system for improper permissions. This will take quite a bit of time (several minutes). It will then produce a list of problems in the /var/adm/sw/swverify.log file.


Bill Hassell, sysadmin
Travis Harp_1
Advisor

Re: ls command gets unreadable error

Are you having any disk connection issues?

I saw something similar to this when a SAN booted system lost access to it's root drive.

It was running out of RAM until I tried to interact with the disks in any way.

Is this the only issue you are having with the system right now?
Achilles_2
Regular Advisor

Re: ls command gets unreadable error

Thanks a lot. Finally I solved the problem: chnage the permission right of /opt to 755. SO I closed this topic now.
Achilles_2
Regular Advisor

Re: ls command gets unreadable error

Thanks all your advance