LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2021, 09:36 AM   #1
missbfbarley
LQ Newbie
 
Registered: Mar 2021
Location: Earth
Distribution: different ones
Posts: 18

Rep: Reputation: 0
Angry Granting Permissions on external SSD


Hi, im newbie, LUKS Encrypted Ext4 Host = Linux machine x64 86 mintOS with 2 users (both me) user1 = sudo and user2 = standard permissions.

and i have a T7 Samsung external SSD which i use as my all files/folders drive as i never keep anything on the host machine at all.
I encrypted using LUKS Ext4 (xfs) and i can use it on user1 no issues but sometimes issues on user2 and sometimes not so im sure the GUI in mint is not quite good enough to deal with permissions or something due to it being glitchy and me unsure 100% what im doing so i tried from user1 to go into Terminal and type =
chmod -R 777 but i got nothing back and i was in sudo so then i typed in = cd / then repeated above chmod -R 777 and still nothing.

Basically i need a way to check said 1TB SSD permissions for disk and contents and a way to solve the issue or just re-do permissions without damage to existing 500g files on the said drive.

I am now also thinking that i need a different last number other than 7 as i no like everyone doing more than read yet not sure of number, i think maybe 5. hence 775 but idk for sure.
 
Old 06-20-2021, 06:49 PM   #2
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 335

Rep: Reputation: Disabled
Quote:
Originally Posted by missbfbarley View Post
me unsure 100% what im doing so i tried from user1 to go into Terminal and type =
chmod -R 777 but i got nothing back and i was in sudo so then i typed in = cd / then repeated above chmod -R 777 and still nothing.
Looking at the man page for chmod
Code:
man chmod
(when you have finished reading type q) it appears that your commands are not telling the computer the file/partitions you want the instruction to be carried out on.

Me I'd use chown (change ownership) command, like

Code:
 chown -r user2 /address of the partition or drive
- changing the label of the drive from it's alphanumeric list to something like cat would also make it easier to type.

Using the above chown command, as root, would make user2 owner of the the partition or drive.

Whether the partition ownership would apply each time you connect the drive is beyond my knowledge.
 
Old 06-21-2021, 12:24 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by missbfbarley View Post
chmod -R 777 but i got nothing back and i was in sudo so then i typed in = cd / then repeated above chmod -R 777 and still nothing.
Be glad that didn't work! You were this close (pinches thumb and forefinger together) to trashing your system!

You can try that on the relevant partition, but only if it contains only data and no system stuff. Even so, I do not recommend it. Chmod -R 777 is NEVER a good idea.

Do you have a way you can reliably reproduce the problem?

For the second user, have you tried unmounting it (as the first user), then re-mounting as the second user?
If that works as expected, it's not a desirable solution but would tell us a lot about where the problem is.
 
Old 06-21-2021, 07:20 AM   #4
missbfbarley
LQ Newbie
 
Registered: Mar 2021
Location: Earth
Distribution: different ones
Posts: 18

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by ondoho View Post
Be glad that didn't work! You were this close (pinches thumb and forefinger together) to trashing your system!

You can try that on the relevant partition, but only if it contains only data and no system stuff. Even so, I do not recommend it. Chmod -R 777 is NEVER a good idea.

Do you have a way you can reliably reproduce the problem?

For the second user, have you tried unmounting it (as the first user), then re-mounting as the second user?
If that works as expected, it's not a desirable solution but would tell us a lot about where the problem is.
The said SSD is like my electronic file system, there are .iso files amongst all nor .pdf, .jpef, .mp4 etc yet i dont use said drive to boot any distro from as im newbie and just using VM's etc for online activities so i no need to do the boot thingy from a usb if thats what you meant.

I am not too sure i can reproduce issue necessarily as i dont fully know this issue, although i try elaborate as maybe me not explain v good.
Basically newbie me just me and only me use my linux host client machine and i not interested in all the permissions thing as i fully encrypt everything so if i loose my SSD then the encryption is what i would be reliant on (LUKS ext4)
Please correct me if you feel my way of thinking is floored and needs to be adjusted?
I just thought that if everything is 777 then i can just pick up another linux machine when mine break, plug in SSD - type password and splendid i am all good to go.
I understand the purpose of Permissions for when others using same pc as different users etc but that never going to happen for me.

idk how to do your last paragraph, nor do i know if i can simply type sudo whist logged into user2 or if i need to keep logging out of user1/user2 to do said commands retrospectively nor do i know if i need said SSD plugged in nor do i know what is unmount other than like eject disk for safe removal.

Ultimately i dont know much other than what i think i want to do.
 
Old 06-21-2021, 07:30 AM   #5
missbfbarley
LQ Newbie
 
Registered: Mar 2021
Location: Earth
Distribution: different ones
Posts: 18

Original Poster
Rep: Reputation: 0
when i plug in this SSD i get what looks to be a greyed out icon to the left of the disk name when viewing disk on left in Nemo file manager, the icon look like a circle with a line diagonal through like a no entry sign for driving yet without color and look like a light grey.

Sometimes the SSD on user2 can remove safely then disappear looking removed yet warning saying no remove, then i go to disks in GUI of mintOS and i see SSD lock open so i click to lock - type password then it locks and no icon on desktop still so i remove with no further warnings or issues.

sometimes whilst on either user1 or user2 i come accross file or folder which say i no permissions as maybe i create using the other user1 or user2 as i change between user 1 and user2 a lot dependant on what im doing.
------------------------------------------------------------
My Operation of use.
So when i go onto a VM i plug in a dedicated USBC 128gb flash drive VFAT Un-encrypted and drag said files onto flash drive.
Then i turn off internet plug in main SSD Ext4 LUKS encrypted drive and drag from flash to SSD then unplug SSD for later use.
I try to only use SSD when not online for obvious reasons.
------------------------------------------------------------
These issues seem minor rather than absolute in that i have operation of files/folders mostly yet sometimes dont fully for when i need say edit or change something so i presume view only.

Now with me doing VM isolation i am extremely concerned as i intend to download .pdf etc from emails etc from VM's so im sure the permissions there will also restrict me at some point claiming that a VM that i may of deleted time ago is the owner of a .pdf which i currently now need to open for example.
------------------------------------------------------------
I think what i need to do is know exactly what is the current permissions command on SSD so i know where its at but the mintOS GUI not tell me and i newbie on the CLI yet im a trier.

Last edited by missbfbarley; 06-21-2021 at 07:44 AM.
 
Old 06-21-2021, 05:42 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
When you install Mint, you were required to create at least one user with a password. That user by default has root permissions if you use sudo in a terminal. You may have some option to use sudo/admin in the GUI. I don't know as I don't use Mint. Any additional users created will generally not have permission to write to any directory outside the /home/user directory unless the sudo user grants permission to the additional user.

Creating mount points and mounting/unmounting drives is pretty basic and there are countless sites with tutorials on it so do an online search and learn it.
 
Old 06-21-2021, 11:27 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
First of all:
If you're such a newb, why do you even have 2 users on your system?
Maybe you want to answer that question first, there might be some sort of XY-problem.

Quote:
Originally Posted by missbfbarley View Post
The said SSD is like my electronic file system, there are .iso files amongst all nor .pdf, .jpef, .mp4 etc yet i dont use said drive to boot any distro from as im newbie and just using VM's etc for online activities so i no need to do the boot thingy from a usb if thats what you meant.
If there are VMs on that SSD I still do not recommend this, but whatever :shrugs:
Mount the SSD, navigate your filemanager to its base directory, and open a terminal.
Enter
Code:
sudo -i
The terminal should show you the path you're in, e.g.:
Code:
root@machine /run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX #
Well, something like that.
To be sure, type
Code:
pwd
and you should get something like "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
Now type
Code:
chmod -R 777 "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
That should do it.

Disclaimer:
Don't come complaining if this borked your system.
This is a sledgehammer method, but you said yourself that using a screwdriver is too much for you.
 
Old 06-21-2021, 11:30 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
First of all:
If you're such a newb, why do you even have 2 users on your system?
Maybe you want to answer that question first, there might be some sort of XY-problem.

Quote:
Originally Posted by missbfbarley View Post
The said SSD is like my electronic file system, there are .iso files amongst all nor .pdf, .jpef, .mp4 etc yet i dont use said drive to boot any distro from as im newbie and just using VM's etc for online activities so i no need to do the boot thingy from a usb if thats what you meant.
If there are VMs on that SSD I still do not recommend this, but whatever :shrugs:
Mount the SSD, navigate your filemanager to its base directory, and open a terminal.
Enter
Code:
sudo -i
The terminal should show you the path you're in, e.g.:
Code:
root@machine /run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX #
Well, something like that.
To be sure, type
Code:
pwd
and you should get something like "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
Now type
Code:
chmod -R 777 "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
That should do it.

Disclaimer:
Don't come complaining if this borked your system.
This is a sledgehammer method, but you said yourself that using a screwdriver is too much for you.



edit:
Original posts for reference:
Quote:
Originally Posted by missbfbarley View Post
when i plug in this SSD i get what looks to be a greyed out icon to the left of the disk name when viewing disk on left in Nemo file manager, the icon look like a circle with a line diagonal through like a no entry sign for driving yet without color and look like a light grey.

Sometimes the SSD on user2 can remove safely then disappear looking removed yet warning saying no remove, then i go to disks in GUI of mintOS and i see SSD lock open so i click to lock - type password then it locks and no icon on desktop still so i remove with no further warnings or issues.

sometimes whilst on either user1 or user2 i come accross file or folder which say i no permissions as maybe i create using the other user1 or user2 as i change between user 1 and user2 a lot dependant on what im doing.
------------------------------------------------------------
My Operation of use.
So when i go onto a VM i plug in a dedicated USBC 128gb flash drive VFAT Un-encrypted and drag said files onto flash drive.
Then i turn off internet plug in main SSD Ext4 LUKS encrypted drive and drag from flash to SSD then unplug SSD for later use.
I try to only use SSD when not online for obvious reasons.
------------------------------------------------------------
These issues seem minor rather than absolute in that i have operation of files/folders mostly yet sometimes dont fully for when i need say edit or change something so i presume view only.

Now with me doing VM isolation i am extremely concerned as i intend to download .pdf etc from emails etc from VM's so im sure the permissions there will also restrict me at some point claiming that a VM that i may of deleted time ago is the owner of a .pdf which i currently now need to open for example.
------------------------------------------------------------
I think what i need to do is know exactly what is the current permissions command on SSD so i know where its at but the mintOS GUI not tell me and i newbie on the CLI yet im a trier.
Quote:
Originally Posted by missbfbarley View Post
The said SSD is like my electronic file system, there are .iso files amongst all nor .pdf, .jpef, .mp4 etc yet i dont use said drive to boot any distro from as im newbie and just using VM's etc for online activities so i no need to do the boot thingy from a usb if thats what you meant.

I am not too sure i can reproduce issue necessarily as i dont fully know this issue, although i try elaborate as maybe me not explain v good.
Basically newbie me just me and only me use my linux host client machine and i not interested in all the permissions thing as i fully encrypt everything so if i loose my SSD then the encryption is what i would be reliant on (LUKS ext4)
Please correct me if you feel my way of thinking is floored and needs to be adjusted?
I just thought that if everything is 777 then i can just pick up another linux machine when mine break, plug in SSD - type password and splendid i am all good to go.
I understand the purpose of Permissions for when others using same pc as different users etc but that never going to happen for me.

idk how to do your last paragraph, nor do i know if i can simply type sudo whist logged into user2 or if i need to keep logging out of user1/user2 to do said commands retrospectively nor do i know if i need said SSD plugged in nor do i know what is unmount other than like eject disk for safe removal.

Ultimately i dont know much other than what i think i want to do.
Quote:
Originally Posted by missbfbarley View Post
Hi, im newbie, LUKS Encrypted Ext4 Host = Linux machine x64 86 mintOS with 2 users (both me) user1 = sudo and user2 = standard permissions.

and i have a T7 Samsung external SSD which i use as my all files/folders drive as i never keep anything on the host machine at all.
I encrypted using LUKS Ext4 (xfs) and i can use it on user1 no issues but sometimes issues on user2 and sometimes not so im sure the GUI in mint is not quite good enough to deal with permissions or something due to it being glitchy and me unsure 100% what im doing so i tried from user1 to go into Terminal and type =
chmod -R 777 but i got nothing back and i was in sudo so then i typed in = cd / then repeated above chmod -R 777 and still nothing.

Basically i need a way to check said 1TB SSD permissions for disk and contents and a way to solve the issue or just re-do permissions without damage to existing 500g files on the said drive.

I am now also thinking that i need a different last number other than 7 as i no like everyone doing more than read yet not sure of number, i think maybe 5. hence 775 but idk for sure.
 
Old 06-25-2021, 01:38 PM   #9
missbfbarley
LQ Newbie
 
Registered: Mar 2021
Location: Earth
Distribution: different ones
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
First of all:
If you're such a newb, why do you even have 2 users on your system?
Maybe you want to answer that question first, there might be some sort of XY-problem.



If there are VMs on that SSD I still do not recommend this, but whatever :shrugs:
Mount the SSD, navigate your filemanager to its base directory, and open a terminal.
Enter
Code:
sudo -i
The terminal should show you the path you're in, e.g.:
Code:
root@machine /run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX #
Well, something like that.
To be sure, type
Code:
pwd
and you should get something like "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
Now type
Code:
chmod -R 777 "/run/media/missbfbarley/XXXXXXX-XXXXXXX-XXXX"
That should do it.

Disclaimer:
Don't come complaining if this borked your system.
This is a sledgehammer method, but you said yourself that using a screwdriver is too much for you.
I didnt realise that by me having 2 user accounts it would bring into question if i am a newbie or not as i have always used 2 users to ensure my online user being user2 doesnt have root access as user2 is for online stuff only hence if i was to get i virus or download something bad then my root user being user1 would be sandboxed as a slight mitigation precaution.
In any event this brings about the question of; when is a newbie not a newbie?

I have no VM's on any external SSD as my VM's (guests) are inside a VirtualManager on user2 of the (Host)
as my external SSD is for files and folders only.

Thanks for the helpful commands, i tried them yet to no avail, sudo -i just changed the last digit from $ to # without any further returned trail.
pwd returned = /root as the only returned info.
I re-tried the last chmod command again regardless yet still nothing unfortunately.
Thanks.
 
Old 06-29-2021, 02:13 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by missbfbarley View Post
I didnt realise that by me having 2 user accounts it would bring into question if i am a newbie or not as i have always used 2 users to ensure my online user being user2 doesnt have root access as user2 is for online stuff only hence if i was to get i virus or download something bad then my root user being user1 would be sandboxed as a slight mitigation precaution.
In any event this brings about the question of; when is a newbie not a newbie?
Let's please not do this. I asked a valid question.
You answered the question; maybe it would then be wise to also give only one of the 2 users access to your SSD?

Quote:
Originally Posted by missbfbarley View Post
Thanks for the helpful commands, i tried them yet to no avail, sudo -i just changed the last digit from $ to # without any further returned trail.
pwd returned = /root as the only returned info.
I re-tried the last chmod command again regardless yet still nothing unfortunately.
Thanks.
Do you know what a directory tree is?
If you run 'chmod -R 777' or some such sledgehammer command, you need to realise that.
/ is the root directory, the base, the one from which all branch out. If you run a recursive ('-R' - do you understand what that does? Maybe read 'man chmod') chmod on /, you change the permissions for everything. That's not just a disaster security-wise, but also likely to break things.
So once again you got lucky that you ran the command on the '/root' directory, which is the root user's home, and not '/'. Phew. Even so, undo it!

Now, you can change directories with the 'cd' command.
You can use the Tab key to autofill long directory names. Try it, it's rather intuitive.
Once you're in the correct directory (i.e. your SSD's base dir), try that chmod command again.

If you're not sure where that directory is, mount your SSD and look at the output of the 'mount' command.

edit:
Code:
ls -al
will tell you if your permission changes succeeded.
Always share output with us.

Last edited by ondoho; 06-29-2021 at 02:14 AM.
 
Old 06-29-2021, 10:16 AM   #11
missbfbarley
LQ Newbie
 
Registered: Mar 2021
Location: Earth
Distribution: different ones
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
Let's please not do this. I asked a valid question.
You answered the question; maybe it would then be wise to also give only one of the 2 users access to your SSD?


Do you know what a directory tree is?
If you run 'chmod -R 777' or some such sledgehammer command, you need to realise that.
/ is the root directory, the base, the one from which all branch out. If you run a recursive ('-R' - do you understand what that does? Maybe read 'man chmod') chmod on /, you change the permissions for everything. That's not just a disaster security-wise, but also likely to break things.
So once again you got lucky that you ran the command on the '/root' directory, which is the root user's home, and not '/'. Phew. Even so, undo it!

Now, you can change directories with the 'cd' command.
You can use the Tab key to autofill long directory names. Try it, it's rather intuitive.
Once you're in the correct directory (i.e. your SSD's base dir), try that chmod command again.

If you're not sure where that directory is, mount your SSD and look at the output of the 'mount' command.

edit:
Code:
ls -al
will tell you if your permission changes succeeded.
Always share output with us.
Yes you are correct, User1 should be isolated from user2 (online stuff) but i need to have access on both user accounts at present for many reasons;
1. I occasionally need to access a file on my main SSD when im online on user2 yet as all my online stuff if only done on a VM i thought it ok to do as user2 is sandboxed from the said VM's hence my SSD does have a layer of protection and my system or so i think.
2. I need to be able to understand how to use said SSD between more than 1 user so when my computer break i can access SSD from any other Linux machine.
3. I need to learn how to do more than 1 user so i can operate with confidence in future endeavours etc.
4. My existing Linux machine doesnt like me to switch user accounts mid session with VM's all open etc, i get glitches and system freezes so i need resolve this issue soon.

My intentions are to do as you suggest, restrict SSD to user1 (non internet) which i will do once i know what im doing and more experienced etc.
-------------------------------
Your response looks very useful but i don't fully understand most of what you said yet i got the gist that 777 command need to only be done when one knows exactly whats going on unlike me not knowing fully and following thoughts and others online commands ignorantly which i seem to of done.
-----------------------------------
Your statement about 777 comand has got me now concerned what ive done if anything so i need to now go back to very basics im thinking.
Please can you tell me, how do i easy check permissions existing on just my host linux machine and would said test need to be from user1 or user2 account or does it not matter as long as i just add sudo before anything?
Also do i need to do same test on user2?
or
does the whole Linux hold the host permissions, i dont quite understand.

Last edited by missbfbarley; 06-29-2021 at 10:53 AM.
 
Old 06-29-2021, 08:03 PM   #12
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 335

Rep: Reputation: Disabled
Quote:
Originally Posted by missbfbarley View Post
hence if i was to get i virus or download something bad
Though it is not impossible for an "ordinary user" to get the computer to get an "infection" it is highly unlikely.

For my money one my the advantages of using linux is that to affect the way your computer runs the "infection" usually needs to become root (su/sudo). So at the very least the infection needs to ask to become root.

If in ANY doubt about what the computer wants to do, don't let the computer become root.

Quote:
when is a newbie not a newbie?
Imho, that is asking how long is this bit of elastic.

One thing that I reckon changes you from a newbie is comming to a site like this and reading a post from another user and thinking I can answer that question - and attempting to do so.
 
Old 06-30-2021, 01:54 AM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by missbfbarley View Post
i don't fully understand most of what you said
I was mostly giving you commands that you can enter in a terminal. Do you know how to do that?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
granting file permissions to a process dynamically beroal Linux - Security 4 03-30-2021 06:05 PM
[SOLVED] setfacl and granting permissions to a group and its members on a directory devUnix Linux - General 7 08-08-2013 12:12 AM
Granting full read/write permissions to all files for a specific user laserjim Linux - Security 10 01-31-2009 11:17 AM
Granting root permissions to a bash script than can be run by a user? SirTristan Linux - Newbie 4 06-14-2008 10:29 PM
granting permissions to a few users in a group grondar69 Linux - General 7 06-22-2006 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration