Operating System - HP-UX
1833867 Members
2023 Online
110063 Solutions
New Discussion

An easy HP-UX question....

 
Yvonne Butler
Regular Advisor

An easy HP-UX question....

I'm ashamed to admit I have a mental block. I've setup a new user within Unix who needs to see the hidden files (e.g. .profile, .kshrc, etc.) I can't remember how to give him access to the hidden files within his own home directory. Any advice greatly appreciated.
16 REPLIES 16
melvyn burnard
Honored Contributor

Re: An easy HP-UX question....

what do you mean by "see the hidden files"?
can he not see them using ls -a or ll -a?


My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Ruediger Noack
Valued Contributor

Re: An easy HP-UX question....

No additional permissions, just use
ls -al

Ruediger
Alan Casey
Trusted Contributor

Re: An easy HP-UX question....

To see them :

ls -a

You should add this alias to his/her .profile or .env:

alias ls="/bin/ls -FA"

To change the permissions on the .files:

chmod xxx .filename
chown to change ownership
Yvonne Butler
Regular Advisor

Re: An easy HP-UX question....

Logged in as himself and using ll or ls -al doesn't show any .* files (e.g. .profile etc). Also when looking at the directory through SAMBA the .* files aren't displayed (unless you're logged in as root or another system administrator)
Steve Steel
Honored Contributor

Re: An easy HP-UX question....

Hi


Check that ll and ls do not point elsewhere


alias|grep ll
alias |grep ls

whence ll ls

Try it with the full path name.

As root do
ll -d .
ll -d .*

check permissions.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Alan Casey
Trusted Contributor

Re: An easy HP-UX question....

Hi,

If when logged in as root an ls -al on this directory shows .files, and when logged in as "user" an ls-al on this directory doesn't then it probably dut to:

The "user" does not have read permission on these files. To correct this as root run:

chmod o+r filename

This will give ALL user read on the files it's run on.

Tim D Fulford
Honored Contributor

Re: An easy HP-UX question....

Hi

All of the above is correct as far as seeing "hidden" files with ls. But you also mention "access" to them:-

1 - Make sure his home directory is owned by the user, as root do
# chown :
e.g.
# chown fulfordt:users /home/fulfordt

2 - Make sure the permissions are correct
as root
# chmod u=rwx,g=rx,o=rx
or
# chmod 755

eg
# chmod 755 /home/fulfordt

3 - similar to 1 above make sure the user owns the .files
# chown :
e.g
# chown fulfordt:users /home/fulfordt/.profile

4 - Similar to 2, Make sure the user has appropriate permissions to files:
# chown u=rw,g=r,o=r
or
# chmod 644
e.g
# chmod 644 /home/filfordt/.profile

All of the above allows the user to
o Read & write to .profile
o Change dir into their home dir & make files there

Personally I use useradd which does all of the above (+more) and all that I need to do is edit the .profile (if needed).

Tim
-
Ruediger Noack
Valued Contributor

Re: An easy HP-UX question....

Do the user see any other files in his home directory? Or is there a problem with the home dir permissions?

Ruediger
Ruediger Noack
Valued Contributor

Re: An easy HP-UX question....

Sorry Alan,

you don't need permissions for the files to see with ls -a, you need only permissions for the directory.

Ruediger
Yvonne Butler
Regular Advisor

Re: An easy HP-UX question....

The home directory is owned by the user and the directory permissions are "drwxr-xr-x". There are no alias's for ll or ls -a. When running ll or ls -a all other files are shown except for files starting with a full stop e.g. .profile.
Ruediger Noack
Valued Contributor

Re: An easy HP-UX question....

hmmm ... it looks fine!
How long is the username?
Check your /etc/passwd for duplicate username entry!

Ruediger
Yvonne Butler
Regular Advisor

Re: An easy HP-UX question....

Yep, checked the /etc/passwd which appears correct especially as there are only 6 users in there. The username is 5 characters long.
Ruediger Noack
Valued Contributor

Re: An easy HP-UX question....

And the output of id looks also fine!?!

Ruediger
Robin Wakefield
Honored Contributor

Re: An easy HP-UX question....

Hi Yvonne,

Does:

echo .*

show anything? Does it show "." and ".."?

Can you show us the output of ls -al .* when performed as root?

Thanks, Robin.
Yvonne Butler
Regular Advisor

Re: An easy HP-UX question....

Ahh, I think I have it now. ls -al shows the .* files so I need to setup an alias for ll to ls -al in the .profile for the user to see these files.

Thanks everyone for all your help, much appreciated....
Magdi KAMAL
Respected Contributor

Re: An easy HP-UX question....

Hi Yvone,

Just :

# ls -a [dir]

and all "hidden" files will be "visible" .

Magdi