Change ownership of files created on different Ubuntu machine

I have two HDD of 1 GB each, and one USB HD 1 GB, used in my old desktop on Ubuntu 16.04 and18.04 to save files. That machine is gone. Now I have a new Dell desktop on Ubuntu 20.04.1.

When I use to read/play/copy/delete files from above drives, connecting through USB port of my present desktop, I found that many of those files are protected hence can not be copy/read/write.

How can I change the ownership of all files on those drives, through my present Dell desktop?
An easy step-by-step tutorial shall be highly appreciated.
Best wishes. :slight_smile:

You perhaps do not need to change permissions of all the files. This post at least in half consists of the XY Problem. At least you have explained the actual problem, too, so we can start right away:
First, before attempting any weird solutions, have a read:

1 Like

Hi @Ashoke,

To change owner ship of the files use the chown command thru the terminal.
sudo chown easyt50:easyt50 asterisk.asterisk would work for someone with user id easyt50.
To change read/write/exec use the command chmod.
sudo chmod 777 asterisk.asterisk . For some reason the * (asterisk dot asterisk will not display)
I doing the above from memory, but the commands are easy to look up.

To be frank, this is terrible advice, not only for the reasons I already depicted, but also because of the simple fact, that it usually is not healthy to blindly chmod 777 an entire partition filled with files.


I strongly recommend against doing this. It probably won’t solve your original problem, anyway.

1 Like

Just curious @Akito, b/c I still somewhat new with Linux, But why was my response not very good (terrible) for files in a directory that already belongs to you? :confused:

That’s why it’s usually not recommended and in this situation it’s not the right solution, anyway.

1 Like

Granted not the best answer. I will be more careful in the future to quality my answer. The poster sounded like an individual who was working with his own HDD with files only belonging to him.

He did not sound like he was using or operating on a server. So for an individual working on his own system, working with his own files on a HDD via USB, my advise was “terrible”.
Yes, maybe I should caution him to make sure he was pointing to the correct device, use caution when using sudo, and be sure not to exec this command pointing at his desktop / root.
@Ashoke, I hope you will have learn a little about mount / umount, chmod, and chown reading thru all this. I offer my advice to help and tho not maybe “the best” answer did not wish any harm to your system.
I have used chown and chmod many times during the past couple of years with no ill affect. I do not use / admin to a server and performed the commands to my own desktop / laptop environment.

Even if the world isn’t exploding in this specific situation, you must not forget that this thread could possibly have hundreds and hundreds of views over the next year. Perhaps even thousands or more. I do not want random people to visit this thread in a year and see your seemingly quick answer and just apply it, because they just don’t know better.

So yes, maybe in this situation nobody would be hurt, but you never know who else is reading, watching and trying to learn from this thread. That’s why my arguments are general, so everyone can profit from them, instead of just a single person in a single specific situation, especially if the situation at hand is extremely unclear in the first place, so recomminding such measure probably won’t solve the problem anyway.

The best way to find a solution to a problem is first understanding the problem itself as best as one can. The better you understand the problem, the better and easier to achieve the solution will become.
So instead of recommending something, that might not be even a bad solution, perhaps not even a solution at all, one should first ask questions and try to understand what one is looking at.

These are my reasons for why your attempt at a solution is a bad example for retrieving and providing an actual solution, which actually solves the actual problem at hand.

Then you are in my eyes extremely lucky, because I have seen, what feels like, tons of people screwing up their whole Linux installations because they thought, just chmoding the root partition might make things easier.
Even if such an operation might be manually revertable, then you can still never be entirely sure if you maybe forgot some place that you need to revert. Then this curse will keep annoying you until you do a fresh reinstall, to finally and certainly get rid of that permission hell.

1 Like

Web “developers” (i.e. Dreamweaver users on a Mac) were the bane of my life : “can’t you just ‘chmod -Rf 777 *’ and that will fix everything”… Pfffft…

1 Like

Hi @Ashoke, I was just wondering if you got your problem resolved.
And if you did fix your problem, what worked?
I have run into the same problem myself.