On 12/23/2011 05:18 PM, gene heskett wrote:
> On Friday, December 23, 2011 06:11:28 PM Mark Cason did opine:
>
>> On 12/23/2011 01:47 PM, gene heskett wrote:
>>
>> Last login: Thu Dec 22 09:38:52 2011 from coyote.coyote.den
>> gene@shop:~$ sudo useradd -u 500 gene
>>
>>
>> to modify a user, you must use usermod:
>> sudo usermod -u 500 gene
>>
>> I haven't used usermod in a loooong time, so I don't know if you need to
>> change user, and group, for all of the files you own.
>>
>> sudo chown -R gene.gene /home/gene
> That has been done long ago Mark.  The problem is that on pclos (this box)
> gene is the first user, with a userid of 500.  On ubuntu, gene is also the
> first user 1000, so when user 500 tries to copy a file to /home/user=1000
> on ubuntu, its 100% no permissions.
>
> Now if the copy utilities used the username, and it was the same $name on
> both machines, there is no clash.


   If I'm remembering the LSB correctly, then all programs on a linux 
box are 'SUPPOSED' to use the group name, instead of the UID/GID, to 
maintain cross-platform compatability.  if the permission of the file is 
group readable (or read/writable), then it should work correctly.

   There are several ways to get around the problem,   The 
quick-and-dirty way to fix this is to do a "chmod +r 'filename' ", and 
set the read flag for all users. A little more involved way, would be to 
do a  "chmod 660 'filename' && sudo chown gene.1000 'filename' ", in 
pclos.  This will give read/write access to user, and group.  Then 
changes group to 1000, which would be valid on the Ubuntu machine. 640 
would probably be more appropriate, if you do not intend to edit on the 
Ubuntu machine.  Copy 'filename' to the Ubuntu machine, and then see 
what happens.

   The major downside to each of these workarounds, is that this would 
have to be done EVERY time you need to copy a file.  A simple script 
could be written to make this easier.  The permanent fix, would be to 
change the UID/GID on the Ubuntu computer, to force it to use 500, 
instead of 1000.  Two ways to do it, are with the usermod command, using 
-u 500 -g 500 or manually editing the /etc/passwd, and /etc/group files 
directly:

sudo cp /etc/passwd /etc/passwd.orig
sudo cp /etc/group /etc/group.orig

sudo vim /etc/passwd:
gene:x:1000:1000:Your Name,,,:/home/gene:/bin/bash
change to
gene:x:500:500:Your Name,,,:/home/gene:/bin/bash

sudo vim /etc/group:
gene:x:1000:
change to
gene:x:500:

   Manually editing these files guarantees that you will need to chown 
your files back to gene.gene.  BUT... This is a one time thing, once 
it's done, it's done.

-- 
-Mark

Ne M'oubliez   ---Family Motto
Hope for the best, plan for the worst   ---Personal Motto


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to