Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:32 AM
05-14-2004 02:32 AM
are very interesting but I still
have questions regarding regular users.
our passwd file shows different ways
to the shell.
root...:/sbin/sh
...:/bin/sh
...:/sbin/sh
...:/usr/bin/sh
they don't seem to be the same
-r-xr-xr-x 2 bin bin 499712 Oct 20 1998 /usr/bin/sh
-r-xr-xr-x 2 bin bin 499712 Oct 20 1998 /bin/sh
-rwxrwxrwx 1 bin bin 389120 Oct 20 1998 /sbin/sh
most of the users have /sbin/sh
a few have /bin/sh
is that ok ?
which is best ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:37 AM
05-14-2004 02:37 AM
Re: sh
The system id such as root, daemon, lp should be /sbin/sh. The user id should have /usr/bin/sh.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:38 AM
05-14-2004 02:38 AM
Solution/sbin/sh should be used primarily for root users since it is only necessary when /usr cannot be mounted.
The permissions on /sbin/sh should be 555.
You would need to run either:
chmod 555 /sbin/sh
or
chmod 555 /sbin/sh
on your system to correct the permissions.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:42 AM
05-14-2004 02:42 AM
Re: sh
But there is a major security problem on your system. /sbin/sh shouldn't be world-writable!!!
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:50 AM
05-14-2004 02:50 AM
Re: sh
/sbin/sh is normally larger as the other shells, because it is statically linked, not smaller.
I think running file /sbin/sh might be interesting, to say the least...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 02:57 AM
05-14-2004 02:57 AM
Re: sh
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.
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).
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.
10.20
# ll /usr/bin/sh /sbin/sh
-r-xr-xr-x 1 bin bin 401408 Dec 2 2002 /sbin/sh*
-r-xr-xr-x 2 bin bin 491520 Dec 2 2002 /usr/bin/sh*
11.0
# ll /usr/bin/sh /sbin/sh
-r-xr-xr-x 1 bin bin 421888 Apr 23 2001 /sbin/sh*
-r-xr-xr-x 2 bin bin 221184 Apr 23 2001 /usr/bin/sh*
11.11
$ ll /usr/bin/sh /sbin/sh
-r-xr-xr-x 1 bin bin 405504 Feb 11 2003 /sbin/sh
-r-xr-xr-x 2 bin bin 208896 Feb 11 2003 /usr/bin/sh
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 03:07 AM
05-14-2004 03:07 AM
Re: sh
I changed the permissions on sbin/sh
should I change the shell reference
in passwd of all my regular users to
...:usr/bin/sh
???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 03:10 AM
05-14-2004 03:10 AM
Re: sh
It wont hurt either way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 03:20 AM
05-14-2004 03:20 AM
Re: sh
the version I'm running
# ll /usr/bin/sh /sbin/sh
-r-xr-xr-x 1 bin bin 389120 Oct 20 1998 /sbin/sh
-r-xr-xr-x 2 bin bin 499712 Oct 20 1998 /usr/bin/sh
# uname -a
HP-UX lacasse B.10.20 U 9000/879 445631361 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2004 03:56 AM
05-14-2004 03:56 AM
Re: sh
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2004 04:30 AM
05-17-2004 04:30 AM
Re: sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2004 08:56 AM
05-17-2004 08:56 AM
Re: sh
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.
And as mentioned, /sbin/sh size looks very wrong. Perhaps it has been hacked. Use the file command to look at it:
# file /sbin/sh
/sbin/sh: PA-RISC1.1 shared executable
# file /usr/bin/sh
/usr/bin/sh: PA-RISC1.1 shared executable dynamically linked
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:
find /sbin /usr/bin -perm -002 -exec ll {} \;
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.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2004 02:30 PM
05-17-2004 02:30 PM
Re: sh
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.
the point is. there are many shells including booting the kernel in maintenance mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2004 03:03 PM
05-17-2004 03:03 PM
Re: sh
mount /usr
mount /var
mount /tmp
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 06:33 AM
05-18-2004 06:33 AM
Re: sh
that system as no outside access
and is relatively secure.
maybe a former administrator changed
the access rights.
the file command gives the folowing info...
#
# file /sbin/sh
/sbin/sh: PA-RISC1.1 shared executable
# file /usr/bin/sh
/usr/bin/sh: PA-RISC1.1 shared executable dynamically linked
#