LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to get rid of the "Lock" sign on files and folders forever?? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-rid-of-the-lock-sign-on-files-and-folders-forever-782767/)

msbstar 01-17-2010 09:48 AM

How to get rid of the "Lock" sign on files and folders forever??
 
Hello,

I have Ubuntu 9.10 installed on my laptop.
every time I save some files in my desktop a sign of "lock"
is appeared attached to the file's icon.
Then by using this command I can remove it:

"chown pc *"

What can I do if I want not to see that sign (the sign of a lock)
anymore?

With best regards,
Hassan

Simon Bridge 01-17-2010 09:51 AM

Make sure you own the files you are saving.

This depends on where you got the files and how you are saving them.

msbstar 01-17-2010 10:04 AM

Would You Please Explain More?

GrapefruiTgirl 01-17-2010 10:09 AM

The LOCK icon means that a file or folder is owned by a privileged user, such as "root", but the user account you are currently logged in as, does not have enough permissions to read the file or enter the folder.
This happens (the LOCK icon) if you for example, edit a file as root, and then save it to a location like a regular users /home folder. The root user will not see the LOCK icon, because he has enough permissions to access the file, but a regular user will see the LOCK icon, because he doesn't have the permission to view the file.

By using the `chown` command (presumably as root, or with sudo) you are changing ownership of something. Changing a "root" owned file or folder, so that it is owned by your regular user, will allow the regular user to now view or access the file/folder.

Does this help?

Sasha

msbstar 01-17-2010 03:04 PM

Hi Sasha,

Thanks a lot for your comprehensive explanation.

Is there any way to let all the users to have access
to any files and folders SO there will be no LOCK
icon any more and forever?
Or we are destined to see the LOCK icon?

Best,
Hassan

GrapefruiTgirl 01-17-2010 03:13 PM

Well, the question you ask above, is not one that has a simple yes or no answer.

One of the core ideas underneath EVERY Linux distribution, is the hierarchy of users with varying levels of privilege. Root is the most powerful user, who can do anything, including destroy the installed system. For this reason, it is not generally accepted practice to give ALL users the same amount of access privilege, otherwise, ANY user could theoretically bork a system really badly.

Most of the stuff on a Linux system is READABLE by regular users, but not WRITEABLE. And, some folders are not even ENTERABLE by a regular user, only root.

Now, you're using Ubuntu, which has even MORE restrictive measures in place: the root account is not even fully enabled, and/or there is no password associated with it, making it very hard for a regular user to damage the system. In the Ubuntu world, you guys use `sudo` to get some limited, temporary root powers.

So, in short, the smart answer is NO, there is no way to allow ALL users to access ALL stuff on the machine freely at will. Letting all users have this sort of access is a bad idea.

Now that we've made that clear, I'll give you another thread to look at, just for another perspective on what you're asking: http://www.linuxquestions.org/questi...om-gui-782655/

And after having read that, if you have further inquirires, feel free to ask! As mentioned in that other thread, I don't use *buntu myself, but loads of users here do, so someone will be able to answer your questions if I cannot.

Cheers!
Sasha

Simon Bridge 01-17-2010 10:52 PM

Another way you can get the lock icon is if you copy a file from one computer to another in a manner which preserves permissions.

I can be user simon on two different computers, but these will often end up as two different simons as far as linux is concerned. Thus the simon@indigo-prime cannot alter files owned by simon@joker even though they are both ordinary users and both me.

I've seen this happen with CDROM backups - the restored files were all locked because the newly created me had a different uid from the original me.

The solution is to choose a method of copying or transferring files which does not preserve permissions. The exact method to use will depend on what Hassan is trying to do - exactly. Because we do not know how Hassan is transferring the files, we cannot really know what to advise.

msbstar 01-18-2010 12:30 AM

HI,

"Sasha" and "Simon Bridge", I thank you so much for your
replies.
I think I understood the situation.

Best regards,
Hassan

bhargavigoswami 08-05-2013 02:43 AM

Just one command would remove lock sign from your file/folder.
 
Follow following steps for removing lock sign from your file/folder.

step 1: open terminal
step 2: sudo su
step 3: give password
step 4: go to location where file/folder is located.
step 5: give following command: chmod a+rwx <file/folder_name>
step 6: Now check whether the lock sign is gone or not.

That's it. Problem solved.


All times are GMT -5. The time now is 03:10 PM.