<body> <!-- www.mybloglog.com --> <script type='text/javascript' src='http://track3.mybloglog.com/js/jsserv.php?mblID=2008020909412660'></script> <!-- www.mybloglog.com -->

Unix command | Unix administrator

Unix | Linux | Solaris | Hp-Ux | Xen ... what the fsck, is sar. Why not use vmstat. Is prstat better than top? Bash, korn, c shell, sea shell? root passwd shadow, su - ssp. Time to mount the nfs and starts with UNIX hosting, much more easier on Linux hosting.

Basic patch execution on HP-UX

Tuesday, February 26, 2008

1. Donwload the required package

2. Make an OS ignite backup
For a virtual server, the ignite backup can be stored in HDD with the command below
# make_net_recovery -s svr6601 -v -x inc_entire=vg00 -x exclude=/var/adm/crash -a svr6601:/var/opt/ignite/clients/svr6604

make_net_recovery
creates a system recovery archive and stores the archive on the network.

Option
-s
Specifies the hostname of the Ignite-UX server. The onfiguration files, defaults and contents files for the client system will be written to the Ignite-UX server in /var/opt/ignite/clients/0xLLA/recovery. The make_net_recovery tool will NFS mount the per-client directory to access this information.

-v
Display verbose progress messages while creating the system recovery archive. Includes information such as which volume groups/disks will be included in the system recovery archive.

-x inc_entire=disk|vg_name
Includes all file systems contained on the specified disk or volume group.  Use a block device file (e.g.,"/dev/dsk/c0t5d0") when specifying a whole-disk (non-volume manager) file system.  Use the volume group name (such as vg00) when you want all file systems that are part of that LVM volume group to be included in the archive.

-x exclude=file|directory

Excludes the file or directory from the archive.  When a directory is specified, no files beneath that directory will be stored in the archive. If the excluded directory is an unmounted file system shown in the /etc/fstab file, a WARNING ("Filesystem xxx is not mounted.  It will be ignored.") message will be displayed.


3. Unpack the patch file, assuming we are unpacking the USB driver 11.23_USB-00_C.01.04.06.001.shar. A new file *.depot will be created after unpack.
# sh 11.23_USB-00_C.01.04.06.001.shar

4. Install the patch
# swinstall -s 11.23_USB-00_C.01.04.06.001.depot

A GUI patch management will pop-up. Follow the installation screen, make sure that the patch packages is in READY mode. Do not proceed if it is in READY & WARNING mode. The WARNING needs to be rectify before proceeding. Please note a server reboot will be require if it touches on the kernel.

posted by MML, 2:34 AM | link | 0 comments |

Using VNC on Linux Server

Tuesday, February 12, 2008

VNC is a well known tools, it’s widely use in Linux and Windows environments. Recently I have a problem accessing my Linux server using VNC sessions. I have forgotten the password, the only way I know to reset the VNC session password is thru GUI unfortunately the server is not located at the same place as I am.

Follow the steps below, some workaround I use to reset VNC session password and also reset VNC connection.

1. Change / create new VNC password
# vncpasswd

2. Starts the VNC server
# vncserver

Example of the output as below …
SUSE:~ # vncserver
New 'X' desktop is SUSE:2

Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/SUSE:2.log

3. Try login in with VNC viewer using hostname/ip address followed by the display number, in this case its suse:2


4. An xTerminal will be displayed as below, but this is not the session we want to use. Follow steps 5 to get the proper sessions …


5. Stops the vncserver. Our VNC server is currently running on display 2.
# vncserver -kill :2

6. Edit the xstartup file. The file is located at /root/.vnc/. Before your start editing the files, please backup the original file, and include the following lines into the xstartup file

#!/bin/sh

#xrdb $HOME/.Xresources
#xsetroot -solid grey
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &

7. Start the vncserver
# vncserver

Test login to the server with VNC viewer, you’ll see a different and useful layout as below


8. To check if there is a vnc services running …
# ps -ef | grep Xvnc

Labels: ,

posted by MML, 8:36 PM | link | 0 comments |

Create a duplicate ROOT id

Monday, February 11, 2008

Duplicating a ROOT id is not a good idea, as this will overkill the security risk. SUDO is another workaround option that you can look into without implementing the 2nd ROOT id. Anyway, below are steps taken by me to create the 2nd ROOT id.

1. Backup all the required files (/etc/passwd, /etc/shadow and /etc/group)
2. Create the user with useradd command

Example
# useradd -g 1 -d /export/home/root2 -s /bin/sh -c "Some infor here" root2

Syntax for useradd
useradd [-u uid [-o] | -g group | -G group[[,group]...] |-d dir |
-s shell | -c comment | -m [-k skel_dir] | -f inactive |
-e expire | -A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value | -p project [, project ...]] login

3. Change passwd for root2
# passwd root2

4. Edit the /etc/passwd file. Search for the id that you have created, in this case root2

root2:x:116:1:Some Info here:/export/home/root2:/bin/sh

In this case the UID is 116. This number is automatically generated unless you have specified the -u option with your useradd command. Use vi editor to edit, change the UID number from 116 to 0

# vi /etc/edit

5. Now all you need to do is update the /etc/passwd file with the command below
# pwconv

pwconv - installs and updates /etc/shadow with information from /etc/passwd
To now more on pwconv, do a man pwconv


posted by MML, 2:05 AM | link | 0 comments |