shians
shians

Reputation: 965

Is it possible to set read-only for myself on unix?

I have been given the address to a very large folder on a shared Unix server. I've been given a path to some files on a unix server I'm working on through ssh. I don't want to waste space by creating a duplicate in my home area so I've linked the folder through ln -s. However I don't want to risk making any changes to the data within the folder.

How would I go about setting the files to read-only for myself? Do I have to ask the owner of the folder/file? Do I need sudo access? I am not the owner of the file and I do not have root access.

Upvotes: 1

Views: 357

Answers (1)

Mykola Shchetinin
Mykola Shchetinin

Reputation: 747

Read about chmod command to change the mask on the files the links point to.

The owner or root can restrict access to files.

Also you probably need to mount that shared folder as read-only. But I am not sure how your folder is connected

UPDATE

The desired behaviour can be achieved using mount tool. (man page for mount).

Note that the filesystem mount options will remain the same as those on the original mount point, and cannot be changed by passing the -o option along with --bind/--rbind. The mount options can be changed by a separate remount command, for example:

mount --bind olddir newdir

mount -o remount,ro newdir

Here is the similiar question to yours. Also solved via mount tool.

Upvotes: 1

Related Questions