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.


Sunday, February 24, 2013

How to add default Route to Oracle Solaris 10

In the name of Allah, Most Gracious, Most Merciful. 
In this article I will describe the configuration command to add default Router temporally and permanently to Oracle Solaris 10.

You can see currently configured routes by following command

netstat -nr

You can delete currently configured default Route by following command

route delete default 192.168.10.251

You can add default router temporarily by following command

route add default 192.168.10.249

You can add default router permanently by following commands

route -p add default 192.168.10.249

Or

echo 192.168.10.249 > /etc/defaultrouter

It will create /etc/defaultrouter file if not already available. Next time you restart you system 192.168.10.249 will be automatically added to default router.


Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.