<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Duplicate UIDs On Linux</title>
	<atom:link href="http://pthree.org/2008/07/17/duplicate-uids-on-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/</link>
	<description>Linux.  GNU.  Freedom.</description>
	<lastBuildDate>Fri, 17 May 2013 20:46:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-beta2-24176</generator>
	<item>
		<title>By: Josef</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-119311</link>
		<dc:creator>Josef</dc:creator>
		<pubDate>Wed, 05 Dec 2012 15:03:27 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-119311</guid>
		<description><![CDATA[I use this to have a second user with bash for sftp-clients.
I use zsh as my shell and have it start in screen at login (so actually screen is my login shell) asd GUI sftp clients don&#039;t work that way. With a second [username]-sftp user with same UID and GID I can transfer files and they have the correct rights.]]></description>
		<content:encoded><![CDATA[<p>I use this to have a second user with bash for sftp-clients.<br />
I use zsh as my shell and have it start in screen at login (so actually screen is my login shell) asd GUI sftp clients don&#8217;t work that way. With a second [username]-sftp user with same UID and GID I can transfer files and they have the correct rights.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: draeath</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-115808</link>
		<dc:creator>draeath</dc:creator>
		<pubDate>Mon, 13 Jun 2011 14:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-115808</guid>
		<description><![CDATA[I&#039;ve run into a case where the clamd packages were expecting the user clamav, and yet other software was insisting (eg replacing the config change on update) on it being clam. The best solution I found to prevent maintenance headaches was to make sure the clamav and clam users/groups have the same ID numbers.

Since I did this, I have yet to have to go back and fix the thing after an update.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve run into a case where the clamd packages were expecting the user clamav, and yet other software was insisting (eg replacing the config change on update) on it being clam. The best solution I found to prevent maintenance headaches was to make sure the clamav and clam users/groups have the same ID numbers.</p>
<p>Since I did this, I have yet to have to go back and fix the thing after an update.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Ceppi</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-111014</link>
		<dc:creator>Marco Ceppi</dc:creator>
		<pubDate>Mon, 28 Jun 2010 18:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-111014</guid>
		<description><![CDATA[AlexP: I used a similar hack for Tomcat - someone needed to upload and modify Tomcat configuration files, and upload webapps, without using SSH (They used SFTP) So I created a user with the same UID/GID as tomcat, as files are modified and written by either the user or tomcat the UID stays the same and permissions can be more restrictive.

However this was, as I consider, a hack. I haven&#039;t seen any negative impacts but with enough brainpower and time I&#039;m sure a better compromise could have been hatched.

I don&#039;t recommend this for production environments.]]></description>
		<content:encoded><![CDATA[<p>AlexP: I used a similar hack for Tomcat &#8211; someone needed to upload and modify Tomcat configuration files, and upload webapps, without using SSH (They used SFTP) So I created a user with the same UID/GID as tomcat, as files are modified and written by either the user or tomcat the UID stays the same and permissions can be more restrictive.</p>
<p>However this was, as I consider, a hack. I haven&#8217;t seen any negative impacts but with enough brainpower and time I&#8217;m sure a better compromise could have been hatched.</p>
<p>I don&#8217;t recommend this for production environments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-110805</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Tue, 13 Apr 2010 14:56:01 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-110805</guid>
		<description><![CDATA[Not sure I follow. You want to create a folder that gives the apache user write access to it automatically? Probably best to use file ACLs. Check out the &#039;setfacl -d&#039; command.]]></description>
		<content:encoded><![CDATA[<p>Not sure I follow. You want to create a folder that gives the apache user write access to it automatically? Probably best to use file ACLs. Check out the &#8216;setfacl -d&#8217; command.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlexP</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-110795</link>
		<dc:creator>AlexP</dc:creator>
		<pubDate>Thu, 08 Apr 2010 08:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-110795</guid>
		<description><![CDATA[I realize this post is almost 2 years old, but hopefully someone jumps back on it?]]></description>
		<content:encoded><![CDATA[<p>I realize this post is almost 2 years old, but hopefully someone jumps back on it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlexP</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-110794</link>
		<dc:creator>AlexP</dc:creator>
		<pubDate>Thu, 08 Apr 2010 08:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-110794</guid>
		<description><![CDATA[So i ran into this &quot;occasion&quot; where i am trying to figure out the proper way to do it, and my &quot;scrappy&quot; brain decided why not duplicate the UID and GID?...

I am learning/setting up CentOS Server admin. I installed vsftpd and apache, and the problem was, if i made any changes or created a folder with the ftpsecure user via my ftp client then apache didnt have privileges to write to that folder unless i chmod 775 the folder opposed to keeping it at 755.

So if my apache UID and GID were 46, i just created another user &quot;example&quot; and then placed the example above apache so it was found on the first pass. 

Now i can create folders via ftp and have apache(php) able to write to them. 

Although this works, i get the hunch its not save or stable?]]></description>
		<content:encoded><![CDATA[<p>So i ran into this &#8220;occasion&#8221; where i am trying to figure out the proper way to do it, and my &#8220;scrappy&#8221; brain decided why not duplicate the UID and GID?&#8230;</p>
<p>I am learning/setting up CentOS Server admin. I installed vsftpd and apache, and the problem was, if i made any changes or created a folder with the ftpsecure user via my ftp client then apache didnt have privileges to write to that folder unless i chmod 775 the folder opposed to keeping it at 755.</p>
<p>So if my apache UID and GID were 46, i just created another user &#8220;example&#8221; and then placed the example above apache so it was found on the first pass. </p>
<p>Now i can create folders via ftp and have apache(php) able to write to them. </p>
<p>Although this works, i get the hunch its not save or stable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rnd</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-105647</link>
		<dc:creator>rnd</dc:creator>
		<pubDate>Fri, 01 Aug 2008 23:36:04 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-105647</guid>
		<description><![CDATA[P.S. Sorry about posting from vista...  I&#039;m at work...]]></description>
		<content:encoded><![CDATA[<p>P.S. Sorry about posting from vista&#8230;  I&#8217;m at work&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rnd</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-105646</link>
		<dc:creator>rnd</dc:creator>
		<pubDate>Fri, 01 Aug 2008 23:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-105646</guid>
		<description><![CDATA[Actually I was thinking about utilizing this to create a second user with the same id as www-data/httpd/apache2 user so I could create a user who could log into a vsftpd chrooted session but be in the doc root with the correct user ID to automatically make files readable to the web server.  Of course the real user running the Apache daemon would remain disabled for login.  Does anybody foresee a major issue with this idea?  Your feedback would be appreciated!]]></description>
		<content:encoded><![CDATA[<p>Actually I was thinking about utilizing this to create a second user with the same id as www-data/httpd/apache2 user so I could create a user who could log into a vsftpd chrooted session but be in the doc root with the correct user ID to automatically make files readable to the web server.  Of course the real user running the Apache daemon would remain disabled for login.  Does anybody foresee a major issue with this idea?  Your feedback would be appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-105166</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 27 Jul 2008 12:39:33 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-105166</guid>
		<description><![CDATA[I once tried this with a regular user, in order to have two KDE stored sessions, depending on if I was online or not. It apparently worked, but then subtle errors which I no longer remember happened down the way. I guess that the ambiguous name given the UID do mattered somewhere. It seemed a good idea at the time, though.]]></description>
		<content:encoded><![CDATA[<p>I once tried this with a regular user, in order to have two KDE stored sessions, depending on if I was online or not. It apparently worked, but then subtle errors which I no longer remember happened down the way. I guess that the ambiguous name given the UID do mattered somewhere. It seemed a good idea at the time, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fergus Doyle</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104912</link>
		<dc:creator>Fergus Doyle</dc:creator>
		<pubDate>Wed, 23 Jul 2008 22:34:21 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104912</guid>
		<description><![CDATA[One reason to use it is if you are using a certain software package and you want to have say a &quot;menu&quot; log in and &quot;shell&quot; and maybe a reports login.  Now what happens is depending on your username you get access to different functionality according to your .profile.  But we still need to be careful about permissions because if we are accessing shared memory or stopping / starting processes we need to have the correct permissions.  Sure you can do most of this through group permissions rather than user perms ions but shared memory can be more _troublesome_ on some versions of Unix not sure where Linux stands on this one though.]]></description>
		<content:encoded><![CDATA[<p>One reason to use it is if you are using a certain software package and you want to have say a &#8220;menu&#8221; log in and &#8220;shell&#8221; and maybe a reports login.  Now what happens is depending on your username you get access to different functionality according to your .profile.  But we still need to be careful about permissions because if we are accessing shared memory or stopping / starting processes we need to have the correct permissions.  Sure you can do most of this through group permissions rather than user perms ions but shared memory can be more _troublesome_ on some versions of Unix not sure where Linux stands on this one though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grsjst</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104680</link>
		<dc:creator>grsjst</dc:creator>
		<pubDate>Mon, 21 Jul 2008 08:23:51 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104680</guid>
		<description><![CDATA[I suppose duplicate uid&#039;s may be helpful for nfs when the same user has differnt uid&#039;s on different machines.]]></description>
		<content:encoded><![CDATA[<p>I suppose duplicate uid&#8217;s may be helpful for nfs when the same user has differnt uid&#8217;s on different machines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tormod</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104466</link>
		<dc:creator>Tormod</dc:creator>
		<pubDate>Fri, 18 Jul 2008 13:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104466</guid>
		<description><![CDATA[&quot;Further, when testing the account against the /etc/passwd file for existence, upon first successful pass is the winning account. That is why ‘whoami’ shows the ‘test_root’ account rather than the ‘root’ account.&quot;

So if you log in as root (as opposed to test_root in your example) &quot;whoami&quot; will return &quot;test_root&quot;? If whoami is meant to &quot;print  the  user  name  associated  with the current effective user ID&quot; that&#039;s a reasonable behaviour.]]></description>
		<content:encoded><![CDATA[<p>&#8220;Further, when testing the account against the /etc/passwd file for existence, upon first successful pass is the winning account. That is why ‘whoami’ shows the ‘test_root’ account rather than the ‘root’ account.&#8221;</p>
<p>So if you log in as root (as opposed to test_root in your example) &#8220;whoami&#8221; will return &#8220;test_root&#8221;? If whoami is meant to &#8220;print  the  user  name  associated  with the current effective user ID&#8221; that&#8217;s a reasonable behaviour.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schroeder</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104465</link>
		<dc:creator>Jeff Schroeder</dc:creator>
		<pubDate>Fri, 18 Jul 2008 12:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104465</guid>
		<description><![CDATA[Editing /etc/passwd is pretty undesirable. If you mess it up, you pork your system. Don&#039;t do that unless you *really* know what you are doing.

Use vipw as it won&#039;t let you save an invalid passwd file, or something along the lines of:
usermod -o -u 0 hax0r

The &quot;-o&quot; allows you to use non-unique uids and doesn&#039;t have a chance of hosing your system. Never try to be too clever, it will bite you in the end.

To answer your question, what if you need to do something that you would normally do with group permissions, but using a group is not really an option? Even if it sounds ugly, it will pop up on the rare occassion.

The solution is generally to use a duplicate UID even if it is discouraged.

@anonymous: Take a look at this simple lockdown script I wrote for Ubuntu, it is intelligent enough to remove the login shells from many users who don&#039;t need it and works from Dapper+ :
http://www.digitalprognosis.com/opensource/scripts/lockdown-ubuntu.sh.txt]]></description>
		<content:encoded><![CDATA[<p>Editing /etc/passwd is pretty undesirable. If you mess it up, you pork your system. Don&#8217;t do that unless you *really* know what you are doing.</p>
<p>Use vipw as it won&#8217;t let you save an invalid passwd file, or something along the lines of:<br />
usermod -o -u 0 hax0r</p>
<p>The &#8220;-o&#8221; allows you to use non-unique uids and doesn&#8217;t have a chance of hosing your system. Never try to be too clever, it will bite you in the end.</p>
<p>To answer your question, what if you need to do something that you would normally do with group permissions, but using a group is not really an option? Even if it sounds ugly, it will pop up on the rare occassion.</p>
<p>The solution is generally to use a duplicate UID even if it is discouraged.</p>
<p>@anonymous: Take a look at this simple lockdown script I wrote for Ubuntu, it is intelligent enough to remove the login shells from many users who don&#8217;t need it and works from Dapper+ :<br />
<a href="http://www.digitalprognosis.com/opensource/scripts/lockdown-ubuntu.sh.txt" rel="nofollow">http://www.digitalprognosis.com/opensource/scripts/lockdown-ubuntu.sh.txt</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104462</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Fri, 18 Jul 2008 11:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104462</guid>
		<description><![CDATA[A third post certainly feels stupid, even though the aim is not to troll.

A. A typo in the above; &quot;without\with\ the UID/GID-combination&quot;.

B. Perhaps you could blog about the shells in default Ubuntu install. Why on earth there is a valid shell for, say, man-pages? This is one of those things that are not &quot;sensible defaults&quot; and gives a serious messy feeling about Ubuntu&#039;s interiors.]]></description>
		<content:encoded><![CDATA[<p>A third post certainly feels stupid, even though the aim is not to troll.</p>
<p>A. A typo in the above; &#8220;without\with\ the UID/GID-combination&#8221;.</p>
<p>B. Perhaps you could blog about the shells in default Ubuntu install. Why on earth there is a valid shell for, say, man-pages? This is one of those things that are not &#8220;sensible defaults&#8221; and gives a serious messy feeling about Ubuntu&#8217;s interiors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://pthree.org/2008/07/17/duplicate-uids-on-linux/#comment-104461</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Fri, 18 Jul 2008 10:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://pthree.org/?p=631#comment-104461</guid>
		<description><![CDATA[Oh, yes and one more thing:

&quot;Further, I’ve heard applications check for the username “root” rather than the UID “0″ like they should.&quot;

You can not obtain any privileges with the UID/GID-combination. The names are just for convenience; I remember that the getuid() -man page was (once) decent on Linux.

Perhaps you should reread about the standard UNIX/Linux DAC model. For multiple superusers, you need MAC or similar solution (think e.g. SELinux), as you probably are well aware of.]]></description>
		<content:encoded><![CDATA[<p>Oh, yes and one more thing:</p>
<p>&#8220;Further, I’ve heard applications check for the username “root” rather than the UID “0″ like they should.&#8221;</p>
<p>You can not obtain any privileges with the UID/GID-combination. The names are just for convenience; I remember that the getuid() -man page was (once) decent on Linux.</p>
<p>Perhaps you should reread about the standard UNIX/Linux DAC model. For multiple superusers, you need MAC or similar solution (think e.g. SELinux), as you probably are well aware of.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
