Monday, February 4, 2013

Portmir in AIX and Unix

What is portmir?
Portmir is a very useful command to share your unix session with another remote user.
The portmir utility allows on TTY stream (monitor) to attach another TTY stream (Target).

Requirements:
1. Two Users should login on server.
Limitations:
1. At any point of time Only one mirror session will be active.

How To do/setup Portmir in AIX:
1. Log in to your Unix server from putty. Here my login ID is subha and host is aixtest.
# who
aixtest:/ # who
subha     pts/0       Feb  4 09:07     (X.X.X.X)


2. Issue command tty it will show your terminal details ..
#tty
aixtest:/ # tty
/dev/pts/0


3. Ask your remote user to login on server ... Here my remote user is reddy
#who
aixtest:/home/reddy $ who
reddy         pts/1       Feb  4 09:10     (X.X.X.X)   -------->Here remote terminal marked in RED
subha         pts/0       Feb  4 09:07     (X.X.X.Y)
aixtest:/home/reddy $


Here you can find your remote colleague terminal (my case remote user terminal /dev/pts1)

4. Run portmir command as Below to start sharing ..
#/usr/sbin/portmir -t pts/1
aixtest:/ # /usr/sbin/portmir -t pts/1
portmir: Remote user connected, mirroring active.
aixtest:/home/reddy $
portmir: Remote user connected, mirroring active.
hostname
aixtest
aixtest:/home/reddy $


5. Once your session is over terminate your portmirror with -o option ..

#/usr/sbin/portmir -o
aixtest:/home/reddy $ /usr/sbin/portmir -o
portmir: Mirroring is stopped.


If you're admin user and the other person temporarily requires root access to do
something (and you can't provide sudo's on emergency basis), then you can su -
in the portmir session, allowing the other person to have root access, while you
can see what he/she is doing.

No comments:

Post a Comment