LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 06-27-2008, 09:16 PM   #1
vansch76
Member
 
Registered: Aug 2007
Location: Asheville, NC, USA
Distribution: Mint 17 Rebecca
Posts: 145

Rep: Reputation: 18
Sharing MP3s between users on the same laptop


Hi everyone

Im having trouble sharing mp3s between two users on my laptop. I have two log ins, (users) for myself. The main login has all my MP3s on it. The second does not. I want to be able to play my mp3s from either login.

I have gone in to my main folder called MP3s, and set the sharing permissions to shared, and it appears to have set it for the main folder. I also opened the MP3 folder and set the permissions
on each sub folder to shared, which shows a shared icon above each sub folder.

When I switch users, I cant find my music. I went back in a copied a few of the files to the public folder under my main log in. but that did not work either.

Im running the latest version of Ubuntu and it says it is up to date.

I will appreciate your suggestions and help

Thanks

Vanessa
 
Old 06-27-2008, 09:54 PM   #2
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
permissions problem?

Woh, this is an unusual problem (if I am actually understanding the problem correctly).
First, you really have two logins for yourself? Well, I suppose you have your reasons for that... Both logins are in the same computer right? Not working on a network/etc, right?

Well, being the case, I can't see why you wouldn't be able to play your mp3 (read the files) by any user. You might have the permissions of your "main" login name's home directory to be 700 (rwx <- read, write, execute for the user and 0, 0, or cant' do anything, for everyone else) set. So, even if you change the permission of one of your directories inside your home directory, you wouldn't be able to read it anyway (being that you can't in fact get into the directory your mp3's are). Let's try something:

If you don't work with more people in the computer you have these two logins (you only have two login names), login as your "main" login name and :
Code:
cd #goes to your home directory, just in case
cd .. #goes to the /home directory, or wherever your home directory is in
chmod 755 $(whoami) # $(whoami) returns your user name. 755 lets anyone read and execute the file, being the owner able to do anything (rwx).
cd #returns to your home dir again
chmod 755 your-mp3s-dir #allows other people access to your mp3s. just in case
cd your-mp3s-dir
chmod 755 * #allows group and other users to read and execute everything in the directory
That should be it. Now logout, login with your other user name and you will be able to access your other user name's dir, and listen to your mp3. You could:
Code:
ln -s ~/../your-main-login-name/your-mp3s-dir/
to make a link to that directory, so you can access that directory directly from the home directory of this other user name.

Last edited by rikijpn; 06-27-2008 at 10:15 PM.
 
Old 06-27-2008, 09:54 PM   #3
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
This problem is a fairly straightforward exercise in file permissions. I hope that this isn't homework from school.

Given two user accounts named a1 and a2, and given that a1 creates and stores mp3 files in a subdirectory of its home directory and owned by it, we want to allow a2 to read the files in a1's home directory. This can be done using the common characteristic of each account; the group membership. Both accounts belong to the user group named users. Any file that is created by either account is also owned by the "users" group. Typically the home directory of user accounts is also owned by the "users" group. So the answer is to modify the permissions of the files to allow the group that owns the files to read them. Usually this is already permitted in a default installation. The system setting that controls the file permissions that are assigned to a file when it is created is called the umask. It represents the opposite of the file settings that you want. The thing that is probably getting in your way is that the home directory of the a1 account probably does not allow the "users" group members to look into that directory. So here are the steps to remediate this.

Assuming that the user accounts have their home directory at /home/a1 and /home/a2 then check to see if the members of the "users" group are allowed to see into the home directory of account a1. The required permission is execute in order to see into a directory. Generally you will also assign read permission to a directory that an account should be able to see into.
Code:
ls -lh /home
If you need to change the permissions you can use the chmod command to do that.
Code:
chmod -c g=rx /home/a1
Then do the same for the /home/a1/mp3 directory.
Code:
ls -lhd /home/a1/mp3
chmod -c g=rx /home/a1/mp3
Now do the same thing for the files in the mp3 directory.
Code:
find /home/a1/mp3 -type f -exec chmod -c g=r {} \;
find /home/a1/mp3 -type d -exec chmod -c g=rx {} \;
Now create a link in the /home/a2 directory that points to the /home/a1/mp3 directory.
Code:
ln -s /home/a1/mp3 /home/a2/mp3
Naturally you will need to use a user account that has permission to do those things. The root account will work for that purpose. You can log into the root account in Ubuntu using the sudo -i command.
Code:
sudo -i

Last edited by stress_junkie; 06-27-2008 at 09:55 PM.
 
Old 06-27-2008, 10:59 PM   #4
vansch76
Member
 
Registered: Aug 2007
Location: Asheville, NC, USA
Distribution: Mint 17 Rebecca
Posts: 145

Original Poster
Rep: Reputation: 18
Thank you both for your quick answers. I followed stess junkies directions and they worked perfectly.
I dont have a clue what all that means, but it works great.

Thanks again

Vanessa

PS no this was not a homework assignment. Im really paranoid about surfing the net, so I have a fake user
setup just for that.
 
Old 06-27-2008, 11:52 PM   #5
steve02169
Member
 
Registered: Feb 2007
Location: Quincy, MA USA
Distribution: Fedora Core 6
Posts: 96

Rep: Reputation: 15
If you'd like to post more details about this you might be able to get a better understanding. I'm guessing that you did something like giving permissions to /home/user/music where you could access ~/music and subdirectories and files but had a problem navigating to it.

Users might have access to the folder /home/user/music but not be able to navigate to it because they do not have access to /home/user. Think of it as a tree with infinite branches where you open up a twig but it's lost in the branch that only the original user can access.

Many people use /usr/share for this so as not to expose their whole home directory to everyone but I often open up /home and use that as a shared directory for music and videos, etc.

My theory could have been tested by typing the full path even though you couldn't see it.

I'll monitor this thread in case anyone posts...

Steve
 
Old 06-28-2008, 05:21 AM   #6
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by vansch76 View Post
Thank you both for your quick answers. I followed stess junkies directions and they worked perfectly.
I dont have a clue what all that means, but it works great.
If you would like more information about file permissions the RUTE on line tutorial is a good place to start.

http://rute.2038bug.com/index.html.gz
http://rute.2038bug.com/node17.html.gz

Quote:
Originally Posted by vansch76 View Post
PS no this was not a homework assignment. Im really paranoid about surfing the net, so I have a fake user setup just for that.
I am glad to hear that this is not a homework assignment. I have the same configuration in my Internet machine. One account uses web browsers and other Internet software. The other account has personal information. I think it is a good idea to separate your files into two accounts like this.
 
  


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
sharing users between several machines coal-fire-ice Linux - Security 3 08-24-2007 02:18 AM
A local wireless network for sharing files (linux desktop+linux laptop+mac laptop) whyatt Linux - Wireless Networking 1 11-01-2005 03:17 PM
Files sharing between users on same computer Artik Linux - Security 5 07-13-2005 02:23 PM
Sharing USB devices between users sleepkreep Linux - Software 1 07-01-2005 09:26 PM
Sharing your printer to Vendow$ Users ikw38 Linux - Newbie 0 12-28-2002 08:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

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

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