Installing sudo on HP-UX

Installing sudo on HP-UX

1. check your OS and server architecture to know which package
to download. Use the uname command.
If it’s an PA-RISC 2.0 architecture, you will normally see
something like this:
# uname -an
HP-UX darwin B.11.11 U 9000/800 1234567 unlimited-user license

else if it’s an Itanium 2
# uname -an
HP-UX darwin B.11.31 U ia64 0987654321 unlimited-user license

From here you can see, the following
HP-UX operating system name
darwin hostname/system name
B.11.11 operating system release identifier
U operating system version identifier
9000/800 machine and model numbers
1234567 machine identification number
unlimited-user operating system license level

2. Go to my favorite Porting and Archiving Centre for HP-UX
based in UK and search the needed packages. URL will be
http://hpux.connect.org.uk

3. Search for package name or description
4. For this tutorial, I will demonstrate how to install it
on a Itanium. Search for “sudo” and download the
necessary package depending on your OS version and
architecture.If you will point your mouse on the HTTP or
FTP link, it will tell you to “Install
gettext,libiconv,zlib first”meaning those are the
dependencies required.
5. Download the following packages

gettext-0.18.1.1-ia64-11.23.depot.gz
libiconv-1.14-ia64-11.23.depot.gz
sudo-1.8.4p2-ia64-11.23.depot.gz
zlib-1.2.6-ia64-11.23.depot.gz

6. Move it to a specified folder if you want, then uncompress it
#gunzip *.gz
7. Install the package as follow:
swinstall -s /etc/sudo-1.8.4p1-hppa-11.23.depot \*
swinstall -s /home/darwin/libiconv-1.14-ia64-11.23.depot \*
swinstall -s /home/darwin/gettext-0.18.1.1-ia64-11.23.depot \*
swinstall -s /home/darwin/zlib-1.2.6-ia64-11.23.depot \*
swinstall -s /home/darwin/sudo-1.8.4p2-ia64-11.23.depot \*

Configuring sudo

1. Normally installation path will be on /usr/local as in files
will be in
/usr/local/bin/sudo
/usr/local/sbin/visudo
/usr/local/etc/sudoers

2. Add user or group in the sudoers using visudo
example

darwin ALL=(ALL) ALL
%group ALL=(ALL) ALL

3.To test if sudo works already, login as normal user and tried this
$ ls -l /usr/local/etc/sudoers
-r–r—– 1 root root 142 Apr 13 12:47 /usr/local/etc/sudoers
$ more /usr/local/etc/sudoers
/usr/local/etc/sudoers: Permission denied
$ sudo more /usr/local/etc/sudoers
Password:
darwin ALL=(ALL) AL
%system ALL=(ALL) ALL

From here can see, cannot display the file sudoers because the
file permission is for root only. When use “sudo”, it is like
temporarily switching a normal user to root to see or
execute commands

Tip:
As default installation, sudo files will be on /usr/local,
so to make your life easier, add it in your path
export PATH=$PATH:/usr/local/bin:/usr/local/sbin

or to make it permanent, put it in your profile path
/home/darwin/.profile

About the author

Free Linux

View all posts

2 Comments

  • While installing these depot reboot is required ?

  • @prashant no reboot required.

Leave a Reply