HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Change permission to 755

 
SOLVED
Go to solution
Chui Kock You_1
Frequent Advisor

Change permission to 755

Hi,

I want change from


[lpctst1]/usr2 # ll
total 0
lrwx------ 1 root sys 6 Feb 22 19:48 uv -> /db/uv

to

[lonpacdr]/usr2 #ll
total 6
drwxrwxr-x 8 root sys 1024 Oct 11 15:10 SBplus
drwxrwxr-x 8 root sys 1024 May 14 2010 SBplus.111010
drwxr-xr-x 2 root root 96 Jan 5 2007 lost+found
drwxrwxr-x 8 root sys 1024 Oct 11 15:10 lp.new
lrwxrwxrwx 1 root sys 6 Nov 10 2008 uv -> /db/uv

What is the command line to change the /db/uv file permission to 755? Any idea.

Regards,
Chui
15 REPLIES
Manix
Honored Contributor
Solution

Re: Change permission to 755

chmod 755 file_name is the method is itnot working for you ?

Thanks
Manix
HP-UX been always lovable - Mani Kalra
nijokj
Trusted Contributor

Re: Change permission to 755

In your case /db/uv is the original file and /usr2/uv is the symbolic link.
If you want to change permission of link only use
chmod -h 755 /db/uv
Chui Kock You_1
Frequent Advisor

Re: Change permission to 755

Hi Manix,

I've try the chmod 755. Is not working. I want to change the symbolic link file not the source file.

Regards,
Chui
nijokj
Trusted Contributor

Re: Change permission to 755

have you tried
lchmod 755 symlinkfile
nijokj
Trusted Contributor

Re: Change permission to 755

Re: Change permission to 755

>What is the command line to change the /db/uv file permission to 755?

The permissions on a symlink don't really matter.
While there is a command to change the ownership of the symlink, there isn't for the permissions.
Chui Kock You_1
Frequent Advisor

Re: Change permission to 755

Hi Dennis,

What is the command to change the ownership of the symbolic link?

Regards,
Chui
nijokj
Trusted Contributor

Re: Change permission to 755

The command is
chown -h own:grp symbolic link
The below url for reference.
http://docs.hp.com/en/B2355-90680/chown.1.html
Chui Kock You_1
Frequent Advisor

Re: Change permission to 755

Hi Nijoki,

Can i used the command umask 000 to change from

[lpctst1]/usr2 # ll
total 0
lrwx------ 1 root sys 6 Feb 22 19:48 uv -> /db/uv

to

[lonpacdr]/usr2 #ll
total 6
lrwxrwxrwx 1 root sys 6 Nov 10 2008 uv -> /db/uv

Regards,
Chui
Jose Mosquera
Honored Contributor

Re: Change permission to 755

Hi,

The umask mask command sets a new file mode creation mask **for the current shell execution environment**.
In your case you are setting **whole** file creation for your active session to 777 file mode, this is very risky concerning system security.
Please carefully read the documentation about:
#man umask

Security practices suggest an umask 022 mode.

Rgds.
Manix
Honored Contributor

Re: Change permission to 755

As Jose said , don`t change umask for the sake of single file.

Thanks
Manix
HP-UX been always lovable - Mani Kalra
Chui Kock You_1
Frequent Advisor

Re: Change permission to 755

Hi Manix,

I've done that on the umask command. It won't corrupt the file. What is the different between the lchmod and the umask? Any manual.

Regards,
Chui
Manix
Honored Contributor

Re: Change permission to 755

lchmod is a system call to change link permission , not a standard command.

Looks at what Clay stated.

The system call chmod() follows the symbolic link and thus does not operate on the symbolic link directly. Similarly, the symlink() system call does not allow a mode argument so that don't work neither. However, there is an UNDOCUMENTED system call, lchmod(), that does operate directly on the symbolic link.


umask - set or display the file mode creation mask.

The mask affects the initial value of the
file mode (permission) bits for subsequently created files.

So umask sets the default file permissions.
HP-UX been always lovable - Mani Kalra
Chui Kock You_1
Frequent Advisor

Re: Change permission to 755

Hi Guru,

Thanks for the help.

Regards,
Chui

Re: Change permission to 755

>Can I used the command umask 000 to change from

Only if you remove then recreate the symlink.
Since you only want to change umask for this one file, you may want to put this in a script so the old umask is restored.