<?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: sh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276572#M179622</link>
    <description>/bin/sh is a symbolic link to /usr/bin/sh.&lt;BR /&gt;&lt;BR /&gt;/sbin/sh should be used primarily for root users since it is only necessary when /usr cannot be mounted.&lt;BR /&gt;&lt;BR /&gt;The permissions on /sbin/sh should be 555.&lt;BR /&gt;&lt;BR /&gt;You would need to run either:&lt;BR /&gt;&lt;BR /&gt;chmod 555 /sbin/sh&lt;BR /&gt;or&lt;BR /&gt;chmod 555 /sbin/sh &lt;BR /&gt;on your system to correct the permissions.&lt;BR /&gt;&lt;BR /&gt;The way you have things right now, someone could modify /sbin/sh and put in a hacker program in its place since they have write permission.&lt;BR /&gt;</description>
    <pubDate>Fri, 14 May 2004 09:38:41 GMT</pubDate>
    <dc:creator>Kent Ostby</dc:creator>
    <dc:date>2004-05-14T09:38:41Z</dc:date>
    <item>
      <title>sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276570#M179620</link>
      <description>the answers regarding sh and root&lt;BR /&gt;are very interesting but I still&lt;BR /&gt;have questions regarding regular users.&lt;BR /&gt;&lt;BR /&gt;our passwd file shows different ways &lt;BR /&gt;to the shell.&lt;BR /&gt;&lt;BR /&gt;root...:/sbin/sh&lt;BR /&gt;...:/bin/sh&lt;BR /&gt;...:/sbin/sh&lt;BR /&gt;...:/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;they don't seem to be the same&lt;BR /&gt;&lt;BR /&gt;-r-xr-xr-x   2 bin        bin         499712 Oct 20  1998 /usr/bin/sh &lt;BR /&gt;&lt;BR /&gt;-r-xr-xr-x   2 bin        bin         499712 Oct 20  1998 /bin/sh&lt;BR /&gt;&lt;BR /&gt;-rwxrwxrwx   1 bin        bin         389120 Oct 20  1998 /sbin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;most of the users have /sbin/sh&lt;BR /&gt;a few have /bin/sh&lt;BR /&gt;&lt;BR /&gt;is that ok ?&lt;BR /&gt;which is best ?</description>
      <pubDate>Fri, 14 May 2004 09:32:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276570#M179620</guid>
      <dc:creator>Alain St-Laurent</dc:creator>
      <dc:date>2004-05-14T09:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276571#M179621</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The system id such as root, daemon, lp should be /sbin/sh. The user id should have /usr/bin/sh. &lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2004 09:37:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276571#M179621</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-05-14T09:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276572#M179622</link>
      <description>/bin/sh is a symbolic link to /usr/bin/sh.&lt;BR /&gt;&lt;BR /&gt;/sbin/sh should be used primarily for root users since it is only necessary when /usr cannot be mounted.&lt;BR /&gt;&lt;BR /&gt;The permissions on /sbin/sh should be 555.&lt;BR /&gt;&lt;BR /&gt;You would need to run either:&lt;BR /&gt;&lt;BR /&gt;chmod 555 /sbin/sh&lt;BR /&gt;or&lt;BR /&gt;chmod 555 /sbin/sh &lt;BR /&gt;on your system to correct the permissions.&lt;BR /&gt;&lt;BR /&gt;The way you have things right now, someone could modify /sbin/sh and put in a hacker program in its place since they have write permission.&lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2004 09:38:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276572#M179622</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2004-05-14T09:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276573#M179623</link>
      <description>/bin/sh == /usr/bin/sh. That is no problem. They can use shared libraries and those are available when normal users log in. But root needs a statically linked shell, since root can login when nothing apart from / (containing /sbin) is mounted, such as LVM maintenance mode. And that is waht /sbin/sh is. A statically linked, smaller, shell.&lt;BR /&gt;&lt;BR /&gt;But there is a major security problem on your system. /sbin/sh shouldn't be world-writable!!!&lt;BR /&gt;And normally /sbin/sh is smaller as the /bin/sh and /usr/bin/sh, not smaller as on your system. What OS version are you using?</description>
      <pubDate>Fri, 14 May 2004 09:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276573#M179623</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-05-14T09:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276574#M179624</link>
      <description>Oops, I think I made a mess of the smaller/larger info.&lt;BR /&gt;&lt;BR /&gt;/sbin/sh is normally larger as the other shells, because it is statically linked, not smaller.&lt;BR /&gt;&lt;BR /&gt;I think running file /sbin/sh might be interesting, to say the least...</description>
      <pubDate>Fri, 14 May 2004 09:50:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276574#M179624</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-05-14T09:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276575#M179625</link>
      <description>/sbin/sh is REQUIRED for the root account.  The reason is that /usr/bin is not available during the boot process and root must be able to do things with the shell.  This is also required when booting to single-user mode.  In single-user mode You only have the / directory mounted so only /sbin/sh is available.&lt;BR /&gt;&lt;BR /&gt;Now /bin and /usr/bin are the same directory.  If you do an 'll /bin' you will notice that it is a link to /usr/bin.  Anything that you use /bin for you should really use /usr/bin.  It is possible that the /bin link may go away someday.&lt;BR /&gt;&lt;BR /&gt;Typically any of the commands in /sbin are statically linked binaries, or StaticBINary, or sbin.  Again, these are used when the libraries in /usr are not available (ie. boot-up or single-user mode).&lt;BR /&gt;&lt;BR /&gt;Now one thing that does worry me is the difference between your /usr/bin/sh and /sbin/sh.  Typically commands in /sbin are larger than in /usr/bin because of the library issue.  You don't say what version of HP-UX this is, but here are some of my sh shells.&lt;BR /&gt;&lt;BR /&gt;10.20&lt;BR /&gt;# ll /usr/bin/sh /sbin/sh&lt;BR /&gt;-r-xr-xr-x   1 bin        bin         401408 Dec  2  2002 /sbin/sh*&lt;BR /&gt;-r-xr-xr-x   2 bin        bin         491520 Dec  2  2002 /usr/bin/sh*&lt;BR /&gt;&lt;BR /&gt;11.0&lt;BR /&gt;# ll /usr/bin/sh /sbin/sh&lt;BR /&gt;-r-xr-xr-x   1 bin        bin         421888 Apr 23  2001 /sbin/sh*&lt;BR /&gt;-r-xr-xr-x   2 bin        bin         221184 Apr 23  2001 /usr/bin/sh*&lt;BR /&gt;&lt;BR /&gt;11.11&lt;BR /&gt;$ ll /usr/bin/sh /sbin/sh&lt;BR /&gt;-r-xr-xr-x   1 bin        bin         405504 Feb 11  2003 /sbin/sh&lt;BR /&gt;-r-xr-xr-x   2 bin        bin         208896 Feb 11  2003 /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;If you notice, all the /sbin/sh files are larger.  I would also change the permissions on your /sbin/sh to -r-xr-xr-x (555).  There is not reason whatsoever to have that file be writeable.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2004 09:57:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276575#M179625</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-05-14T09:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276576#M179626</link>
      <description>Wow !!! Thanks for the fast responses.&lt;BR /&gt;&lt;BR /&gt;I changed the permissions on sbin/sh&lt;BR /&gt;&lt;BR /&gt;should I change the shell reference&lt;BR /&gt;in passwd of all my regular users to &lt;BR /&gt;&lt;BR /&gt;...:usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;???</description>
      <pubDate>Fri, 14 May 2004 10:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276576#M179626</guid>
      <dc:creator>Alain St-Laurent</dc:creator>
      <dc:date>2004-05-14T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276577#M179627</link>
      <description>The only benefit to doing that is that you will have consistency should anything change in the future.&lt;BR /&gt;&lt;BR /&gt;It wont hurt either way.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2004 10:10:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276577#M179627</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2004-05-14T10:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276578#M179628</link>
      <description>in response to your inquiry about &lt;BR /&gt;the version I'm running&lt;BR /&gt;&lt;BR /&gt;# ll /usr/bin/sh /sbin/sh                                            &lt;BR /&gt;-r-xr-xr-x   1 bin        bin         389120 Oct 20  1998 /sbin/sh   &lt;BR /&gt;-r-xr-xr-x   2 bin        bin         499712 Oct 20  1998 /usr/bin/sh&lt;BR /&gt;# uname -a                                                           &lt;BR /&gt;HP-UX lacasse B.10.20 U 9000/879 445631361 unlimited-user license    &lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2004 10:20:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276578#M179628</guid>
      <dc:creator>Alain St-Laurent</dc:creator>
      <dc:date>2004-05-14T10:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276579#M179629</link>
      <description>Since this is 10.20 you should be OK with those shells.  I noticed after I posted that on my 10.20 machine that /usr/bin/sh IS larger than /sbin/sh.  That seems a bit strange to me but it is apparently correct.&lt;BR /&gt;&lt;BR /&gt;As said, you could change all /bin to /usr/bin if you like.  At this point they are the same.  If you are going to stay on 10.20 on this machine and never upgrade it, I wouldn't worry too much.</description>
      <pubDate>Fri, 14 May 2004 10:56:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276579#M179629</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-05-14T10:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276580#M179630</link>
      <description>You should use /usr/bin/sh instead of /bin/sh.  The default list of legal user shells has /usr/bin/sh but does not have /bin/sh.  See "man getusershell".  If a user's shell is not in the default list or listed in /etc/shells, then that account won't be able to ftp into the system.</description>
      <pubDate>Mon, 17 May 2004 11:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276580#M179630</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2004-05-17T11:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276581#M179631</link>
      <description>For consistency, all the users that have the POSIX shell /bin/sh should be changed to /usr/bin/sh. This is the default shell location. As mentioned. /bin/sh does not exist! Instead, it is a link to the 'real' location and may go away someday (although that has been said for almost 10 years now). The industry standard for SysV V.4 filesystem layout removes the old /bin and /lib directories and moves them to /usr/bin and /usr/lib respectively.&lt;BR /&gt; &lt;BR /&gt;Since /sbin/sh is statically linked, the executables will not use shared libraries, thus increasing the amount of RAM for each /sbin/sh instance. Not a lot of RAM but for dozens to hundreds of users, this might be somewhat important.&lt;BR /&gt; &lt;BR /&gt;And as mentioned, /sbin/sh size looks very wrong. Perhaps it has been hacked. Use the file command to look at it:&lt;BR /&gt; &lt;BR /&gt;# file /sbin/sh&lt;BR /&gt;/sbin/sh:       PA-RISC1.1 shared executable&lt;BR /&gt;# file /usr/bin/sh&lt;BR /&gt;/usr/bin/sh:    PA-RISC1.1 shared executable dynamically linked&lt;BR /&gt; &lt;BR /&gt;The "dynamically linked" indicates that this program uses shared libraries. I would NOT trust /sbin/sh, especially because it had 777 permissions. Any file or directory with 777 is a huge security risk and you cannot trust the contents of those files or directories. Get a clean version of /usr/bin/sh from another machine or patch the POSIX shell to the latest version and you'll get new executables. I would perform a security check for world-writable permissions, expecially in /sbin and /usr/bin:&lt;BR /&gt; &lt;BR /&gt;find /sbin /usr/bin -perm -002 -exec ll {} \;&lt;BR /&gt; &lt;BR /&gt;This command MUST return nothing. If it shows and files or directories, they must be assumed to be corrupt and either an intruder or a very bad sysadmin has messed with your system. I would also include /etc in the list to be scanned.</description>
      <pubDate>Mon, 17 May 2004 15:56:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276581#M179631</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-05-17T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276582#M179632</link>
      <description>I believe when you use SAM to create users, you have a slection of choices.  I'm not sure if /sbin/sh is a default option.&lt;BR /&gt;&lt;BR /&gt;which brings to mind, have you ever booted an HPUX kernel in Maintenance mode  before and notice the shell it boots ?  you dont' have acces to the editor vi or ed.  I don't belive you can even mount afile system.&lt;BR /&gt;&lt;BR /&gt;the point is.  there are many shells including booting the kernel in maintenance mode.&lt;BR /&gt;</description>
      <pubDate>Mon, 17 May 2004 21:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276582#M179632</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2004-05-17T21:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276583#M179633</link>
      <description>Just to clarify: /sbin/sh runs in single user mode, /usr/bin/sh does not since /use is not mounted. However, you can mount the required directories in single user mode (there is /sbin/mount). In single user mode, to use vi or other tools not found in /sbin, just mount these:&lt;BR /&gt; &lt;BR /&gt;mount /usr&lt;BR /&gt;mount /var&lt;BR /&gt;mount /tmp</description>
      <pubDate>Mon, 17 May 2004 22:03:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276583#M179633</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-05-17T22:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: sh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276584#M179634</link>
      <description>thank you for your security concerns &lt;BR /&gt;&lt;BR /&gt;that system as no outside access&lt;BR /&gt;and is relatively secure.&lt;BR /&gt;&lt;BR /&gt;maybe a former administrator changed&lt;BR /&gt;the access rights.&lt;BR /&gt;&lt;BR /&gt;the file command gives the folowing info...&lt;BR /&gt;&lt;BR /&gt;#                                                              &lt;BR /&gt;# file /sbin/sh                                                &lt;BR /&gt;/sbin/sh:       PA-RISC1.1 shared executable                   &lt;BR /&gt;# file /usr/bin/sh                                             &lt;BR /&gt;/usr/bin/sh:    PA-RISC1.1 shared executable dynamically linked&lt;BR /&gt;#                   &lt;BR /&gt;&lt;BR /&gt;                                           &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 May 2004 13:33:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh/m-p/3276584#M179634</guid>
      <dc:creator>Alain St-Laurent</dc:creator>
      <dc:date>2004-05-18T13:33:23Z</dc:date>
    </item>
  </channel>
</rss>

