?
Solved

Permissions for softlink

Posted on 2010-03-29
10
Medium Priority
?
550 Views
Last Modified: 2013-11-17
How go I change permissions on a softlink

cd /opt
ls -l
lrwxrwxrwx    1 root     system           24 Mar 29 14:37 apps -> /home/oraapps/opt/apps

Now i do
chown oracle:dba apps

It still shows
rwxrwxrwx    1 root     system           24 Mar 29 14:37 apps -> /home/oraapps/opt/apps

So how do I change the permissions for a softlink
0
Comment
Question by:sgangenamoni
10 Comments
 
LVL 9

Expert Comment

by:Amol
ID: 29009233
The link is just a shortcut to the file/dir. you may own the file, and someone else may own the symlink. they can delete the symlink, but not the original file. if you make the file read-only to everyone else, they shouldn't be able to make it writeable with a symlink.
0
 
LVL 9

Expert Comment

by:Amol
ID: 29009343
You have to change the permission or ownership for apps in /home/oraapps/opt
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 29012495
If you use this command under /opt
ls -lL
you would see the real file permision, you can't change the link permision. In fact the permision on the link (apps in this case) is 777, which means everyone has read, write and excute permision. But the actual permision for this link is based on the real file.
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 

Author Comment

by:sgangenamoni
ID: 29012900
Yes I can but I want to see the change at /opt
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 29013865
If you want to change the link permision, you can use hard link instead.
0
 
LVL 9

Expert Comment

by:Amol
ID: 29015505
yes...u need to use the hard link to see the permission change at /opt
0
 
LVL 9

Expert Comment

by:Amol
ID: 29015719
Remember,

Hard links only work within a filesystem. In other words, don’t use hard links between mounted filesystems. A hard link is only a reference to the original file, not a copy of the file. If the original file is deleted, the information will be lost.

To create a hard link of the file /export/home/fred/stuff to /var/tmp/thing, use:

ln /export/home/fred/stuff /var/tmp/thing

The syntax for creating a hard link of a directory is the same. To create a hard link of /var/www/html to /var/www/webroot, use:

ln /var/www/html /var/www/webroot
0
 
LVL 48

Expert Comment

by:Tintin
ID: 29015997
What are you trying to achieve?

If you want oracle to own the link, remove the current link and recreate it as the oracle user.
0
 
LVL 13

Accepted Solution

by:
Rowley earned 2000 total points
ID: 29064625
chown -h oracle:dba apps

Will change the owner of the symlink.
0
 
LVL 81

Expert Comment

by:arnold
ID: 29090511
A soft link has all rights, but the enforcement on whether usera has access to the files/directory to which the soft link points is done by the file system and the settings on the real file/directory.

Using the options other have provided deal with altering the security on the real files.
Changing ownership on the soft link does not alter the underlying file ownership if -H as others have pointed out and would not change whether usera who is now reflected as the owner of the soft link will have access to the real file/directories.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question