<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Deny just ssh root clone logins in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471294#M744384</link>
    <description>First, I have to agree with the others and say:&lt;BR /&gt;root clones = BAD IDEA!&lt;BR /&gt;&lt;BR /&gt;Now that that's out of the way, here's my suggestion. This is hackable (ANYTHING is hackable with root privileges) but I suspect it is much easier to overlook than .profile&lt;BR /&gt;&lt;BR /&gt;In the "Deny ssh root logins, but allow ssh remote commands?" thread, see the big long post by Ralph Grothe, specifically the ~root/.ssh/rc script.&lt;BR /&gt;That one had me stumped for hours when I tried to undo his suggestions. It just kept immediately logging me out.&lt;BR /&gt;If you put that in the cloneroot's .ssh directory it should have the same effect.&lt;BR /&gt;Make sure it's owned by root and has 400 permissions, so they can't see the contents(unless/until they su)</description>
    <pubDate>Wed, 26 Jan 2005 11:55:08 GMT</pubDate>
    <dc:creator>Gordon  Morrison</dc:creator>
    <dc:date>2005-01-26T11:55:08Z</dc:date>
    <item>
      <title>Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471289#M744379</link>
      <description>Hi all, i've a question for anyone could help me.&lt;BR /&gt;My question is: Is it possible to deny ssh root clones logins, but allow ssh root login?&lt;BR /&gt;&lt;BR /&gt;I've read the very interesting thread about&lt;BR /&gt;"Deny ssh root logins, but allow ssh remote commands?" but my problem is a bit different.&lt;BR /&gt;I'd like to deny ssh logins for all users that are clones of user 'root' BUT allow ssh login for the "real"(and unique) 'root' user.&lt;BR /&gt;&lt;BR /&gt;I've created the clone by the command:&lt;BR /&gt;/usr/sbin/useradd -u 0 -g root -d /root -c "Root Clone" -o -n -r cloneroot&lt;BR /&gt;&lt;BR /&gt;and I use Linux Red Hat:&lt;BR /&gt;$ uname -a&lt;BR /&gt;Linux &lt;HOSTNAME&gt; 2.4.22 #1 SMP Mon Jun 23 18:54:03 CEST 2003 i686 unknown&lt;BR /&gt;&lt;BR /&gt;I think that a good (?) solution could be edit '.profile' file in root home and type:&lt;BR /&gt;&lt;BR /&gt;NAME=`logname`&lt;BR /&gt;if [ $NAME = cloneroot ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Esco"&lt;BR /&gt;  read&lt;BR /&gt;  exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Is this the unique way to do it? I' ve also read about configuring variable 'PermitRootLogin yes' in '/etc/ssh/sshd_config' file but it doesn't seem to be able to select only root clones.&lt;BR /&gt;&lt;BR /&gt;Any idea? (if it is possible...)&lt;BR /&gt;Thanks&lt;/HOSTNAME&gt;</description>
      <pubDate>Wed, 26 Jan 2005 06:29:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471289#M744379</guid>
      <dc:creator>Mib_2</dc:creator>
      <dc:date>2005-01-26T06:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471290#M744380</link>
      <description>Clone (alternate) root logins should NEVER be permitted on a secure system. The concept of a root user is defined by the passwd file, long after ssh or telnet or rlogin have connected to your system. Just like /var/adm/inetd.sec, filtering at the lowlevel TCP/IP is not possible because login is a special program that just happens to be run AFTER a connection is made. And don't put tests about logins in .profile!! A hacker won't use the 'real' root $HOME directory, thus bypassing your .profile. Such tests belong in /etc/profile just after you disable CTRL-C and other escapes. &lt;BR /&gt; &lt;BR /&gt;One of the first types of hacker attacks is to modify an ordinary user login to have UID=0, thus the reason for the command: logins -d to watch for such hacks. While a clone username may seem unique, it is handled ONCE with the login command which does a simple serial search of the passwd file. From then on, the user is defined as a UID. Commands such as ls -l will NOT show the clone username, it will show the first UID match. Tools like id and usermod will fail because a match is made with the UID, not the username. &lt;BR /&gt; &lt;BR /&gt;A secure system will scan systems for duplicate user IDs on a regular basis as a part of an intrusion detection process.</description>
      <pubDate>Wed, 26 Jan 2005 07:58:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471290#M744380</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-01-26T07:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471291#M744381</link>
      <description>You are making accounts that have duplicate UID=0. &lt;BR /&gt;&lt;BR /&gt;To begin, I would have to say "don't do it"&lt;BR /&gt;&lt;BR /&gt;To answer your question, use the `id` command to check the the username, not the UID.&lt;BR /&gt;&lt;BR /&gt;id -un&lt;BR /&gt;&lt;BR /&gt;This will return the $LOGNAME and not the UID number.</description>
      <pubDate>Wed, 26 Jan 2005 10:38:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471291#M744381</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-01-26T10:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471292#M744382</link>
      <description>Absolutely not prudent to do this.&lt;BR /&gt;&lt;BR /&gt;There should be one root account and if possible under organization rules only the sysadmin should use it.&lt;BR /&gt;&lt;BR /&gt;Limited priviledges can be granted by using the sudo utility.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 26 Jan 2005 11:08:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471292#M744382</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-01-26T11:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471293#M744383</link>
      <description>First of all, thanks a lot for the appreciate tips.&lt;BR /&gt;&lt;BR /&gt;But (I'm sorry to say 'but') I still don't know if editing the '.profile' file is the unique way to distingush the user.&lt;BR /&gt;&lt;BR /&gt;Now (thanks Bill) I understood that this way (.profile) is very poor and easy to hack (and I wont use it!).&lt;BR /&gt;The command 'logname' display the correct logname (cloneroot) while the 'id' command  always returns "uid=0(root)" (as well for 'root' as well for 'cloneroot').&lt;BR /&gt;&lt;BR /&gt;So, even if not prudent, is it possible to distinguish between the real 'root' and its clones during remote login?&lt;BR /&gt;I thought there was in 'sshd_config' file something like 'PermitRootLogin root, clone1, clone2' (e.g. denying remote login for 'cloneroot') but it's isn't so.&lt;BR /&gt;&lt;BR /&gt;??</description>
      <pubDate>Wed, 26 Jan 2005 11:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471293#M744383</guid>
      <dc:creator>Mib_2</dc:creator>
      <dc:date>2005-01-26T11:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471294#M744384</link>
      <description>First, I have to agree with the others and say:&lt;BR /&gt;root clones = BAD IDEA!&lt;BR /&gt;&lt;BR /&gt;Now that that's out of the way, here's my suggestion. This is hackable (ANYTHING is hackable with root privileges) but I suspect it is much easier to overlook than .profile&lt;BR /&gt;&lt;BR /&gt;In the "Deny ssh root logins, but allow ssh remote commands?" thread, see the big long post by Ralph Grothe, specifically the ~root/.ssh/rc script.&lt;BR /&gt;That one had me stumped for hours when I tried to undo his suggestions. It just kept immediately logging me out.&lt;BR /&gt;If you put that in the cloneroot's .ssh directory it should have the same effect.&lt;BR /&gt;Make sure it's owned by root and has 400 permissions, so they can't see the contents(unless/until they su)</description>
      <pubDate>Wed, 26 Jan 2005 11:55:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471294#M744384</guid>
      <dc:creator>Gordon  Morrison</dc:creator>
      <dc:date>2005-01-26T11:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Deny just ssh root clone logins</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471295#M744385</link>
      <description>As mentioned, you need to edit /etc/profile, not .profile and use the logname command to test how the user logged in, something like this:&lt;BR /&gt; &lt;BR /&gt;if [ $LOGNAME = cloneroot )&lt;BR /&gt;then&lt;BR /&gt;echo "Esco"&lt;BR /&gt;read&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;Note that login sets the environment variable LOGNAME to the result of the /usr/bin/logname command, so you can save the extra assignment statement.&lt;BR /&gt; &lt;BR /&gt;To answer your question, ssh does not provide any method to lockout cloned UID=0 usernames. This must be done in /etc/profile.</description>
      <pubDate>Wed, 26 Jan 2005 13:05:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/deny-just-ssh-root-clone-logins/m-p/3471295#M744385</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-01-26T13:05:42Z</dc:date>
    </item>
  </channel>
</rss>

