LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-05-2013, 03:34 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,868

Rep: Reputation: 62
my account lacks permission to read or write to anything else


For some reason, my user account does not have permission to read or even open other disks--either the other partition (I have only one other right now), or my backup USB stick, or the memory of my MP3 player. I guess it's not an ownership problem, because even sudoing (using su -, even), I can't chown the stick to myself--permission denied. I can't touch anything else except with the root account. It's ridiculous--I'm the owner and sole user of this computer. What do I need to change?

My distro is antiX, if that matters. (I may have done something wrong, but I don't remember having this problem on other distros.) I'm running it on another USB stick.

Last edited by newbiesforever; 04-05-2013 at 03:59 PM.
 
Old 04-05-2013, 04:55 PM   #2
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,528

Rep: Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705
Do you get any output - warnings/messages - when you try to change ownership?
Just to be clear, you are running AntiX from a flash drive? How did you get it on the flash drive? Full install, live usb creator of some kind? You should be able to access, at least to read other drives.
 
Old 04-05-2013, 05:39 PM   #3
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,868

Original Poster
Rep: Reputation: 62
I used a full install. I looked into live USB, but decided not to make a liveCD on this stick.
 
Old 04-05-2013, 07:33 PM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 12,669

Rep: Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684
you have tried booting into single user and checking the permissions ?
 
Old 04-05-2013, 11:59 PM   #5
gangadhar402
Member
 
Registered: Mar 2013
Location: the India
Distribution: Ubuntu,Debian and CentOS
Posts: 35

Rep: Reputation: 2
Hi,

I often use this for giving special permissions to user without requiring any password

#echo "username ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers


hope will helpful
 
Old 04-06-2013, 01:20 AM   #6
John VV
Guru
 
Registered: Aug 2005
Posts: 12,669

Rep: Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684Reputation: 1684
putting all and no pass in sudoers is asking for big trouble

you might as well login to the gui as root
every non root user will have root access

That defeats the purpose OF "sudo"
 
Old 04-06-2013, 03:32 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,990
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
I agree.

@gangadhar402: if you don't understand why this is the wrong thing to do then please ask.
 
Old 04-06-2013, 04:53 AM   #8
gangadhar402
Member
 
Registered: Mar 2013
Location: the India
Distribution: Ubuntu,Debian and CentOS
Posts: 35

Rep: Reputation: 2
Hi,

I know the problems with this but I forgot to mention ....

For the typical single user workstation such as the desktop Debian system on the laptop PC, it is common to deploy simple configuration of sudo(8) as follows to let the non-privileged user, e.g. penguin, to gain administrative privilege just with his user password but without the root password.
# echo "penguin ALL=(ALL) ALL" >> /etc/sudoers

Alternatively, it is also common to do as follows to let the non-privileged user, e.g. penguin, to gain administrative privilege without any password.
# echo "penguin ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

This trick should only be used for the single user workstation which you administer and where you are the only user.


[Warning]
Warning


Do not set up accounts of regular users on multiuser workstation like this because it would be very bad for system security.



[Caution]
Caution


The password and the account of the penguin in the above example requires as much protection as the root password and the root account.



[Caution]
Caution


Administrative privilege in this context belongs to someone authorized to perform the system administration task on the workstation. Never give some manager in the Admin department of your company or your boss such privilege unless they are authorized and capable.



[Note]
Note


For providing access privilege to limited devices and limited files, you should consider to use group to provide limited access instead of using the root privilege via sudo(8).



[Note]
Note


With more thoughtful and careful configuration, sudo(8) can grant limited administrative privileges to other users on a shared system without sharing the root password. This can help with accountability with hosts with multiple administrators so you can tell who did what. On the other hand, you might not want anyone else to have such privileges.




My opinion : from the above its not a big problem, if we use this in personal computer ..

@John VV : I to agree with u

@unSpawn :thank you for your suggestion..

Last edited by gangadhar402; 04-06-2013 at 04:55 AM.
 
Old 04-06-2013, 08:35 AM   #9
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
As for mounting something, you may specify the "user" mount option in /etc/fstab for the particular partition so you'd be able to mount it as regular user, just like the usual default for CD-ROMs.

*nix systems honor security, which is why the server world is dominated by Linux. And yes, using ALL/NOPASSWD as sudo rule really breaks all security in one line, so i'd strongly advise against that, because any process running under your user account would gain unrestricted root access. Unlike e.g. Windows, having root access means you're god. So be careful with that. I only use ALL/NOPASSWD on certain virtual machines where security really doesn't matter and where the VM also has no access (via network) to anything sensible.
 
Old 04-06-2013, 11:27 AM   #10
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,868

Original Poster
Rep: Reputation: 62
I forgot to mention: one of the reasons I'm so annoyed is I can't even learn the needed information on my backup USB stick (or other devices) to enter it in fstab. Can't mount them, can't open them, can't even eject them. Well, unless I go into the root account. I think I know what you mean about specifying the "user" mount option--I've done it before--but without knowing what my backup USB stick is--sd[letter]--I guess I can't do it.

I'm not at all ruling out the possibility that my USB ports--at least these front ones that I've tried plugging my backup USB stick into--are messed up in some way. But that wouldn't explain why I also can't do anything to another partition.




I think I'll temporarily try nopasswd just to see if anything changes. I suspect it won't, in which case the problem must be something else.

Nope, nopasswd had no effect. I'll take that out ofsudoers, but something else must be wrong.



Hmmmmmm, here's a possible clue. I was running a file manager (Thunar) out of a terminal to try to access my inaccessible USB devices. I glanced at the terminal window, which was displaying responses to what I do in Thunar. The X terminal won't let me copy and paste, but it said "unsupported block device" for every USB device I tried to open.

Last edited by newbiesforever; 04-06-2013 at 12:10 PM.
 
Old 04-06-2013, 12:36 PM   #11
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
You don't need to know the /dev/sdX name of a device if you label the partition(s) on the USB stick.

use "fdisk -l" to see what devices/partitions are present, then use e.g. e2label or ntfslabel to give that partition a certain (unique) disk label, such as "MY_USB_SOMETHING" (dont use more than 16 chars which works with any file system).

Then, whenever you plug-in that device, you can use LABEL="MY_USB_SOMETHING" instead of /dev/sdXY in your /etc/fstab, never again worrying about device names as they are temporary anyhow.

For manual mounting without anything defined in /etc/fstab, you can mount /dev/disk/by-label/MY_USB_SOMETHING instead of /dev/sdXY.

It is also possible to use UUIDs instead, but they're long, cryptic and inconvenient for manual usage. Use the blkid command to see which partitions use which UUID.
 
1 members found this post helpful.
Old 04-06-2013, 01:24 PM   #12
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,868

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by bloody View Post
You don't need to know the /dev/sdX name of a device if you label the partition(s) on the USB stick.

use "fdisk -l" to see what devices/partitions are present, then use e.g. e2label or ntfslabel to give that partition a certain (unique) disk label, such as "MY_USB_SOMETHING" (dont use more than 16 chars which works with any file system).

Then, whenever you plug-in that device, you can use LABEL="MY_USB_SOMETHING" instead of /dev/sdXY in your /etc/fstab, never again worrying about device names as they are temporary anyhow.

For manual mounting without anything defined in /etc/fstab, you can mount /dev/disk/by-label/MY_USB_SOMETHING instead of /dev/sdXY.

It is also possible to use UUIDs instead, but they're long, cryptic and inconvenient for manual usage. Use the blkid command to see which partitions use which UUID.
Thanks, that information helped. What if the system wants to treat my backup USB stick (which I don't always keep plugged in) as a pluggable device to be handled by udev? If I write an fstab entry for it anyway, will it override whatever udev says about it? I had just asked about this issue in another thread, and TobiSGD said the system would treat my stick as a hard disk, but he was referring to the stick I use to run my system. Would it treat another USB stick that I plug and unplug all the time the same way? Does "pluggable device" mean only devices that don't have memory to read from or write to?

Last edited by newbiesforever; 04-06-2013 at 01:31 PM.
 
Old 04-06-2013, 01:35 PM   #13
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
Udev will generate the /dev/disk/by-label entry, and your desktop might do a little more, like, if there is no matching entry in /etc/fstab, create a (temporary) icon for that device (one per mountable partition) on the desktop.

If you write an /etc/fstab entry for the stick (using LABEL="XXXX"), then you'll be just fine because it will always work; the desktop will usually recognize that and not create an icon then. Udev won't mess around with your /etc/fstab, but some desktop distros used to temporarily add entries there at the bottom, but that also won't matter because your hand-written entry comes first and therefor will be used. Just make sure that your disk labels are unique across devices so you'd always mount exactly the partition you desire.
 
1 members found this post helpful.
Old 04-06-2013, 01:51 PM   #14
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
Addendum: "pluggable device" only means the the /dev/sdXY entries are used temporarily and are therefor not very reliable, as pulling out a device renders them useless, and the next time you plug-in the same device it's possible that it gets a different device name assigned, especially if you have plugged-in another device in the meantime which now occupies that name.

Just try using unique disk labels and the uncertainty will go away.. :P
 
Old 04-06-2013, 01:56 PM   #15
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Glendale, AZ
Distribution: Distro-homeless. Lost.
Posts: 1,868

Original Poster
Rep: Reputation: 62
Okay. With the third line added for my backup USB stick, my fstab now says:
Quote:
# Pluggable devices are handled by uDev, they are not in fstab
UUID=dcadd52d-7788-41ff-b777-d1da14c0c623 / ext4 defaults,noatime 1 1
LABEL="BACKUP USB" fat32 defaults
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0622 0 0
# Dynamic entries below
/dev/cdrom /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
/dev/sr1 /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
/dev/cdrom1 /media/cdrom1 udf,iso9660 noauto,users,exec,ro 0 0
/dev/sr0 /media/cdrom1 udf,iso9660 noauto,users,exec,ro 0 0
I typed "defaults" because I didn't know any other settings for it except that it's fat32.

While I'm looking at the fstab, can you answer another question about something else I noticed? You can see from the dynamic entries that I have two optical drives. Why does fstab generate two entries (one cdrom and one sr) for each of them? Are they not redundant?

Last edited by newbiesforever; 04-06-2013 at 01:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission to control read/write in Samba problem. uncle-c Linux - Newbie 1 10-28-2009 07:26 PM
Read/write permission to ALL users on a directory and everything in it Virtuality Linux - Newbie 3 12-13-2007 08:29 PM
share read and write permission to users suguname Mandriva 3 01-18-2005 12:53 AM
Read and Write permission jing Linux - Newbie 3 07-13-2004 10:33 PM
Read/write permission skopje909 Linux - General 4 11-08-2001 02:41 PM


All times are GMT -5. The time now is 12:21 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration