pity-riotous
pity-riotous
pity-riotous
pity-riotous
hyenas
hyenas
hyenas
hyenas
Linux on your Apple Mac | iLinux • View topic - File access for both MacOSX and Ubuntu

File access for both MacOSX and Ubuntu

File access for both MacOSX and Ubuntu

Postby linuxopjemac » Sat Apr 10, 2010 9:25 am

I found it was fairly easy to migrate the UID and GID of my user so that I could mount my Snow Leopard partition and have access to the media on it.

Note that in all the steps, we’re only substituting the numbers. If your entries don’t look exactly as described (with the exception of “powdermonkey” being an alias for your username as it appears to you on your machine), then you may have multiple users installed where I did not while writing this. If you get scared, however, its best to back out and undo the changes.
Moving on:

Using Ubuntu, tested on Lucid Lynx and Karmic Koala, and most likely working on previous versions, we will do as follows:

* Create a temporary user and give the user administrative priveleges.
* Log out and log into our temporary user.
* Change the settings of a file that keeps the GDM login manager from displaying the user after we make the change.
* Edit /etc/passwd and /etc/group to reflect changes to our user and group ID (UID and GID) of our original account.
* Change the file permissions of our original account’s home folder to correspond with the changes to our user and group ID.
* Reboot.
* Delete the temporary user.

-To create a temporary user, go to System > Users and Groups.
-Click “Add”.
-Enter your password.
-Type temp as a name for the purposes of staying consistent with this article.
-Hit the “OK” button.
-Give the account a password and hit “OK”.
-Make sure the temp account is highlighted and hit the button that says “Advanced Settings”.
-Choose the “User Priveleges” tab and tick the box “Administer the System”.
-Hit “OK”. You may have to enter your currently logged in password again at this point, not the one you just created unless they are the same.
-Close the window.
-You may want to open a terminal copy this page’s address, and type echo this/pages/address > /home/temp/where
-Log out of all instances of your current user both at the GUI and if you’ve logged in at the terminal via Alt-F1 for example.
-Log in to the temp account.
-If you can’t remember where these instructions were, the URL is in that file called “where” that we created a few lines up. If you’re confused about that, stop now.

-To make the GDM Login Screen accepting of the change we’re about to make, we need to edit the file /etc/login.defs for the proper parameters
Code: Select all
sudo -i
gksudo gedit /etc/login.defs


-Now find the value UID_MIN. Change it from 1000 to 501. Go down just a bit and find the value GID_MIN and change it to 501 as well.
-Save the file and exit.
-Next on the list is changing our GID. For the example, we will assume that your username is powdermonkey. Find your real username in place of it.
Code: Select all
sudo -i
gksudo /etc/group


-Find the line that says this -
Code: Select all
powdermonkey:x:1000:

and change it to this:
Code: Select all
powdermonkey:x:20:

-The dialout group also has an ID of 20, so we’ll change it (changing only the number)
Code: Select all
dialout:x:20:powdermonkey

to this
Code: Select all
dialout:x:99:powdermonkey

-Save the file and exit.
-Next is to change the UID and GID in the /etc/passwd file. Again, for the example we’ll assume that your username is powdermonkey. We’ll call your real name that you gave the system, during install, Jacob.
Code: Select all
sudo -i
gksudo /etc/passwd


-Find the line that says this -
Code: Select all
powdermonkey:x:1000:1000:Jacob,,,,:/home/powdermonkey:/bin/bash

and change it to this -
Code: Select all
powdermonkey:x:501:20:Jacob,,,,:/home/powdermonkey:/bin/bash


Note that in both of the above files, all we are changing is the number, 1000:1000 for the first installed user in this example, to 501:20 and that "Jacob" will in many cases be the same as your username, though it is not the rule and we pay no attention to that part anyway.

The last step is to change all the file permissions of your home folder – not the temp account, but the original one, which again we will refer to as having the username, powdermonkey. Substitute the folder name of your account (usually your username) for powdermonkey.
Code: Select all
sudo -i
cd /home
chown -R 501:20 powdermonkey


If this did not work and you got a message stating that one of the files could not be changed, it is likely that you are still logged in as powdermonkey somewhere on the system. Try rebooting and logging as temp at the Login Screen.
If all has gone well reboot, and log back in as your normal user, the powdermonkey one, not the temp one.

-Go back to System > Administration > Users and Groups
-Select the temp account by highlighting it, hit the “Delete button”, enter your password, and select to delete the files of the temp account.

That’s it, you should be done. Note that you can only mount the Mac partition as a read only filesystem, but at least you can listen to your music or grab your Documents to work on while your Linux install does whatever task its doing.

Original article here.
linuxopjemac
Site Admin
 
Posts: 541
Joined: Tue Feb 02, 2010 8:48 am

Return to Software

Who is online

Users browsing this forum: No registered users and 0 guests

cron
pity-riotous
pity-riotous
pity-riotous
pity-riotous
hyenas
hyenas
hyenas
hyenas