LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-09-2009, 09:36 PM   #1
markgmiller
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Rep: Reputation: 0
How do I grant Read Permissons on a USB Hard Drive


hello all:
I've just setup sftp on my Ubumtu 8.04 and now I'd like to grant access to an account with read only permissions to my USB Hard Drive. I've created and account, logged into the account which created the home directory, but when I try to access the USB Drive I cannot read or display the contents.
I'd like to setup read and file scan permissions on selected fileshare. So far the only way I was able to get access to the USB Drive was to log on to the my computer with my normal account, plug in the USB Drive which then was granted read/write permissions and then I could access it from the public internet using filezilla. When I log in using my guest account I cannot perform a directory listing, I get access denied. Any help would be greatly appreciated.

Here is the ls -l on the folder I'm trying to share:

drwx------ 2 mmiller root 32768 2009-04-09 15:10 SharedData
 
Old 04-09-2009, 09:54 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try creating a group (say sftp), do a chown -R mmiller:sftp SharedData (to remove the silly root group with no access), a chmod +x SharedData (so everyone can list the directory contents), and a chmod -R g+r SharedData/* so everyone in the sftp group can read the data).

Then add the users for whom you wish to grant access to the sftp group.

Note: I know nothing about ftp access control, so the above is how I'd go about granting members of a specific group access to files on a directory. Unless the ftp access requires a system login, the above is probably not applicable.
 
Old 04-09-2009, 10:12 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First, make sure that you use the UUID in your fstab entry so that the correct filesystem is referenced.
Which filesystem does it use? If it is fat32, then you need to use the uid, gid, fmask and dmask options to determine the permissions on the drive. For a native Linux filesystem, you can use the chown & chmod commands as indicated in the last post.

If a user to gain access isn't the owner or a group member, you can use ACLs to add another user with read access. Using a group would be a better idea.
 
  


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
Trying to read hard drive from old system through a USB enclosure NailCreekPub Linux - Hardware 5 03-21-2009 09:57 AM
USB hard drive mounts as "Read Only Filesystem" augu2000 Linux - Hardware 11 07-12-2007 10:37 AM
Copying files from internal Hard drive to USB 2.0 Hard Drive is NOT Behaving tubatodd Ubuntu 4 02-19-2007 04:32 PM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Setting permissions on an external USB hard drive so that all users can read from it? Pi Man Linux - Hardware 2 09-07-2004 09:50 PM

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

All times are GMT -5. The time now is 08:55 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