Tuesday, February 26, 2013

How to setup sudo on Oracle Solaris 10


In the name of Allah, Most Gracious, Most Merciful

sudo program executes a command with super user privileges with out login with super user. su command do the same but requires to login with super user. In this article i will describe to install and configure sudo packages on Oracle Solaris 10.

You need to have following packages to properly install sudo program. I assumed fresh Oracle Solaris 10 installed which don't have following packages installed.


You can get stable (or latest) releases of these packages from this website. you can use pkginfo command to check if these packages are already installed on your system.

pkginfo SMClinconv

You can install the above packages by transferring these packages to Solaris system and then switch to root user.

su - root
gunzip libiconv-1.9.2-sol10-x86-local.gz
pkgadd -d libiconv-1.9.2-sol10-x86-local

gunzip libgcc-3.4.6-sol10-x86-local.gz
pkgadd -d libgcc-3.4.6-sol10-x86-local

gunzip libintl-3.4.0-sol10-x86-local.gz
pkgadd -d libintl-3.4.0-sol10-x86-local

gunzip sudo-1.8.3p2-sol10-x86-local.gz
pkgadd -d sudo-1.8.3p2-sol10-x86-local

respond with "add" and "y" to questions asked by pkgadd program.

Now you can create symbolic link for sudo program
ln -s /usr/local/etc/sudoers /etc/sudoers
ln -s /usr/local/bin/sudo /bin/sudo
ln -s /usr/local/bin/sudoedit /bin/sudoedit 
Now last thing is to add privileged users to /etc/sudoers
This file has 0440 privileged so you need make is writable to add users.
chmod 0777 /etc/sudoers
vi /etc/sudoers
##
## User privilege specification
##
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL 
now save and change file privileges to 0440 by using following command
chmod 0440 /etc/sudoers
Now exit from root and verify command by following method
/bin/sudo -u root /usr/sbin/ping localhost
If everything is write you will see response 
localhost is alive
if some library missing error you can see which library is missing by using
following command with root user
ldd /bin/sudo
you will see some (file not found) errors. note library name and download the
packages and use the above method to install missing packages.

Installation and Configuration of sudo program completes. Insha-Allah this will
help and serve the purpose. For any corrections and improvements please suggest.


5 comments:

  1. Hi,With potential Qatari sponsors and can help to organise all of the relevant paperwork and registrations that are required to start a Registered Agents in Qatar.Thanks....

    ReplyDelete
  2. ## User privilege specification
    root ALL=(ALL) ALL
    oracle ALL=(ALL) ALL

    ASLM,

    how to do in linux,I tried above procedure but no result.please guide me.

    Thankyou for your time

    ReplyDelete
  3. Does the procedure outlined above hold good for both X86 and Sparc machines ?

    In my setup which is on Sparc architecture i have sudo installed but none of these below listed packages are present



    1. SMCliconv

    2. SMClgcc346

    3. SMClintl

    4. SMCsudo


    If this procedure is only for X86 arch machines, please let us know the procedure for Sparc machines.

    ReplyDelete
  4. I followed all the directions but ended up getting an error.
    root@idmux01 # /bin/sudo -u root /usr/sbin/ping localhost
    /bin/sudo: cannot execute

    ReplyDelete
  5. Download the packages from
    http://ftp.riken.jp/Sun/sunfreeware/sparc/5.10/

    ReplyDelete