LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   no write access for users, only root. (https://www.linuxquestions.org/questions/slackware-14/no-write-access-for-users-only-root-685672/)

linuxpokernut 11-24-2008 01:02 AM

no write access for users, only root.
 
I had a similar problem a while back.
http://www.linuxquestions.org/questi...ssions-573012/

Whenever I boot my machine and go into root i have full permissions. Whenever I log in as a user however I cannot get write mode working. Logging into root will let me save files as root.

I tried swtting up my user as a sudoer. This was actually a challenge as I have never used vi and or visudo, but i conquered that issue. Short story long, sudo works but again no rwx for user.

So what I am guessing is take the solution from the thread I posted and insert it into the appropriate startup script.

Is this correct or is there an easier solution I skimmed over in slackbook?

billymayday 11-24-2008 01:34 AM

What directory are you in?

If it's your home, what are permissions of the user's home directory (ie /home/username) and ownership?

What's the file system?

Is this a mounted partition (ie are you within a mountpoint below /)?

saulgoode 11-24-2008 01:57 AM

If I understand correctly, you have a VFAT partition and you wish to have regular users provided with write access to it. You have found that the following command sets things up properly and therefore wish to have this "autoconfigured" at bootup.
Quote:

mount -t vfat /dev/sda1 /media/hdd -o rw,uid=0,gid=104,umask=000
The "proper" way to accomplish this at bootup is to edit the /etc/fstab file and add the following line:
Quote:

/dev/sda1 /media/hdd vfat rw,uid=0,gid=104,umask=000 1 2

linuxpokernut 11-24-2008 01:59 AM

Ah, it is my storage drive I am talking about, although I have 3 drives that mount at bootup to the /drives/ directory I created specificly for that durning instalation.
Code:

jpo@slackin:/drives$ ls -l
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxr-xr-x 1 root root 4096 2008-11-19 15:29 storage/
drwxr-xr-x 1 root root 4096 2008-11-23 16:44 winblows/
jpo@slackin:/drives$ chmod storage +w

So this doesent do anything...

Code:

jpo@slackin:/drives$ sudo chmod +w storage
Password:
jpo@slackin:/drives$ ls -l
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxr-xr-x 1 root root 4096 2008-11-19 15:29 storage/
drwxr-xr-x 1 root root 4096 2008-11-23 16:44 winblows/

Neither does this...

Code:

jpo@slackin:/drives$ sudo chmod 777 storage
jpo@slackin:/drives$ ls -l
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxr-xr-x 1 root root 4096 2008-11-19 15:29 storage/
drwxr-xr-x 1 root root 4096 2008-11-23 16:44 winblows/

But unmounting and remounting with proper permissions works great.

Code:

jpo@slackin:/drives$ sudo umount /dev/hdb1...
jpo@slackin:/drives$ sudo  mount -t ntfs /dev/hdb1 /drives/storage -o rw,uid=0,gid=104,umask=002
jpo@slackin:/drives$ ls -l
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxrwxr-x 1 root  104 4096 2008-11-19 15:29 storage/
drwxr-xr-x 1 root root 4096 2008-11-23 16:44 winblows/

So I have no problem re-mounting the drive(s) with proper permissions and getting the correct access mode. I don't quite know where in the bootup process the script is that mounts those drives, I just want to alter it slightly so I dont have to do this every time i log in.

billymayday 11-24-2008 02:03 AM

Should be in /etc/fstab shouldn't it?

linuxpokernut 11-24-2008 02:34 AM

Quote:

Originally Posted by saulgoode (Post 3352495)
If I understand correctly, you have a VFAT partition and you wish to have regular users provided with write access to it. You have found that the following command sets things up properly and therefore wish to have this "autoconfigured" at bootup.


The "proper" way to accomplish this at bootup is to edit the /etc/fstab file and add the following line:

It was in that example (fat32). Its NTFS in this one. Looks like we were replying at the same time.

one more question, how do I find or assign group ID to each user. In the example from the previous thread i was running fedora and gid 104 worked fine. It does not apply here i dont think as i cannot save, however the folder is green which means it worked, now i just have to make it work for the correct user.

Once I figure that out I can edit those lines into my /etc/fstab. I completely forgot about that file because i was reading slackbook and it mentions several scripts that it loads and this one
Quote:

rc.local
Contains any specific startup commands for your system. This is empty after a fresh install, as it is reserved for local administrators. This script is run after all other initialization has taken place.
looked like it would work, but didnt have the command in it. I didnt want to tell my drives to mount here if something that was loading before it already told them to mount a certain way.

**
reading is fundamental. its in /etc/passwd
shows me my gid and uid so i can use either.**

linuxpokernut 11-24-2008 03:06 AM

Code:

jpo@slackin:~$ sudo umount /dev/hdb1
Password:
jpo@slackin:~$ sudo  mount -t ntfs /dev/hdb1 /drives/storage -o rw,uid=500,umask=000
jpo@slackin:~$ ls -l /drives
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxrwxrwx 1 jpo  root 4096 2008-11-19 15:29 storage/
drwxr-xr-x 1 root root 4096 2008-11-23 16:44 winblows/

Gets me in there but when I go to save a file, access denied. I am stumped.

*Problem solved, thank you*
If anyone wants to explain what the 2 numbers after the umask in the fstab file signify however i would like to understand better. Thank you for the help.

/dev/sda1 /media/hdd vfat rw,uid=0,gid=104,umask=000 1 2

billymayday 11-24-2008 03:47 AM

[deleted]

saulgoode 11-24-2008 04:06 AM

The fifth field of an fstab entry indicates how often the partition should be backed up (1=every day, 2=every other day, etc). I believe it is ignored in modern GNU/Linux systems but Patrick seems to put a "1" there and I trust his judgment.

The sixth field indicates the order in which 'fsck' is to be executed during bootup. The root partition should be checked first and so the sixth field for its entry should "1". The order of other partitions should not matter and their entries should contain a "2" (unless 'fsck' is never to be run for the partition, in which case the sixth field should contain "0").

Perhaps for a VFAT partition, the sixth field should be set to "0" -- I don't use Microsoft partitions so I'm not sure.

linuxpokernut 11-24-2008 04:39 AM

thanks. it really helps to understand what i'm doing.

rworkman 11-24-2008 03:15 PM

http://slackwiki.org/Windows_Partitions

billymayday 11-24-2008 04:22 PM

If you unmount both of those partitions, what does ls -l /drives show?

linuxpokernut 11-24-2008 06:26 PM

Quote:

Originally Posted by billymayday (Post 3353197)
If you unmount both of those partitions, what does ls -l /drives show?

Code:

jpo@slackin:~$ ls -l /drives
total 12
drwxr-xr-x 2 root root 4096 2008-11-19 22:30 flash/
drwxr-xr-x 2 root root 4096 2008-11-19 22:29 storage/
drwxr-xr-x 2 root root 4096 2008-11-19 22:29 winblows/


billymayday 11-24-2008 06:41 PM

Can you try

mount -t ntfs /dev/hdb1 /drives/storage -o rw,uid=your_uid,gig=your_gid

and

mount -t ntfs /dev/hdb1 /drives/storage -o rw,umask=000

linuxpokernut 11-24-2008 08:55 PM

Quote:

Originally Posted by billymayday (Post 3353322)
Can you try

mount -t ntfs /dev/hdb1 /drives/storage -o rw,uid=your_uid,gig=your_gid

and

mount -t ntfs /dev/hdb1 /drives/storage -o rw,umask=000

Yes, I tried both of those before I edited my fstab, neither method worked, once i did that (edited fstab) everything works fine. I was just asking about the 5th and 6th fields as I wanted to know what i was doing, not just cut/paste/forget.


All times are GMT -5. The time now is 07:35 AM.