Secondary Login


 
Thread Tools Search this Thread
Operating Systems HP-UX Secondary Login
# 1  
Old 12-12-2011
Secondary Login

Hi

In Linux I set Secondary Logging in the way below.
Code:
1. We perform this by adding below lines into 
/root/.bashrcfile :

# secondary logging beginexport HISTSIZE=600000export HISTFILESIZE=600000export HISTTIMEFORMAT="%F %T %z "export HISTFILE=/root/.bashhist/root_history-$(who am i | awk '{print $1}';exit)export PROMPT_COMMAND='history -a'# secondary logging end

2. Create dir 

mkdir /root/.bashhist

---------- Post updated at 09:06 PM ---------- Previous update was at 09:03 PM ----------

In hp-ux I wanted the same to achieve but /usr/bin/sh doesn't have variable HISTTIMEFORMAT.

How to add timestamp to log file in HP_UX ??

Last edited by vbe; 12-13-2011 at 05:51 AM..
# 2  
Old 12-12-2011
Include a unique username, timestamp and terminal id (tty) combination in $HISTFILE . This gives you a separate History File for every session.
There is no facility in HP-UX Posix Shell to timestamp every line in the command history.
# 3  
Old 12-13-2011
Since I dont have a linux nor bash to play with let me ask you what does the output look like? (to see what we can do to get the most approaching result...).
Do these extra addition (I suppose so) get filtered by the history when you use history facility (like recall of some previous commands...)? ( will be far more difficult if not impossible in HP-UX...).
methyl suggestion is the best you could do if keeping things simple... I add extra information but I dont leave them in .sh_history ( as stated above..) except one line in my account (to test how pervert it could be for side effects...) which add the login time at each connection: At the end of my .profile I have:
Code:
print -s "LOGIN - `date '+%m-%d-%E-%H:%M'`"

# 4  
Old 12-13-2011
More preciselly I described it here.
Secondary Logging -> usage of shared account (root)

It based on linux in my example.
# 5  
Old 12-13-2011
On my favorite box I have in root's .profile:
Code:
# Set up shell variables:
        SUFF=`who am i -R| awk -F " " '{print $1"."$NF}'`
        export HISTFILE=/home/root/.sh_history.$SUFF
        MAIL=/var/mail/root
        # don't export, so only login shell checks.
        print -s "LOGIN - `date '+%m-%d-%E-%H:%M'`"
        echo "WARNING:  YOU ARE SUPERUSER !!\n"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Secondary Authentication of UNIX .

Hi All, My Servers are enabled with a secondary authentication of login. Whenever we are logging in to the servers with a common id it is asking like something " Enet your personal id and password" which has been created by UNIX admins previously. Just curious how to achieve this... (1 Reply)
Discussion started by: Showdown
1 Replies

2. Solaris

DNS Primary and Secondary

hi there, i using salaris 10 as my DNS server. i have 2 dns server primary and secondary. if primary dns server i edit/update, the other secondary dns server must be sync too. How can i configure if dns server (primary) can sync the secondary? (1 Reply)
Discussion started by: tappetmus
1 Replies

3. Red Hat

How to find Secondary Group only?

Hi, I would like to know how to find our secondary group of user only. I have used the command id -Gn user1 it is showing both groups of user. Primary and secondary group. (2 Replies)
Discussion started by: manoj.solaris
2 Replies

4. UNIX for Dummies Questions & Answers

Secondary DNS not working

hi guys I am doing some testing for DNS I got a master DNS(192.168.2.10) and I setup a slave DNS(192.168.2.11) but when I shutdown the Master DNS my linux client cannot resolve using the slave any idea way? This is the named.conf options { query-source port 53; directory... (9 Replies)
Discussion started by: kopper
9 Replies

5. UNIX for Dummies Questions & Answers

secondary sorting

how would i sort a file on the fourth field as the primary sort and the third field as a secondary sort? (1 Reply)
Discussion started by: trob
1 Replies

6. IP Networking

secondary and private IP connection

hosta(eth0)----|switch|---(eth0)hostb say hosta and hostb both connect to a swtich using eth0 with public IP addresses, and I add secondary and private IP on hosta and hostb's same eth0 interfaces. So in order for them to reach each other, do I need to config the switch? (3 Replies)
Discussion started by: fedora
3 Replies

7. UNIX for Advanced & Expert Users

How get secondary ID. ??

This is one our office BOX Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Kisses% rlogin pebblz01 -l adminID Password: Last login: Sat Feb 14 01:11:36 from Kisses Please enter your own login id and password. Your login: I_rule Your password:xxxxx From the above... (3 Replies)
Discussion started by: dashok.83
3 Replies

8. Solaris

new secondary disk

I just added a new disk i suppose the disk is not supported by sun solaris pls can someone advice on what i can do. pls see below: # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1d0 <DEFAULT cyl 15934 alt 2 hd 255 sec 126> ... (6 Replies)
Discussion started by: seyiisq
6 Replies

9. IP Networking

secondary TCP application

:cool: I want to use 2 tcp applications in SCO 5.05 senerio I am using VisionFS 3.1 and I need to set it up as a secondary tcp app. I follow the profeditoir and change the tcp port from the primary port (139) to any other number below port 1024 and then restart the VisionFS server it is still... (2 Replies)
Discussion started by: lanman
2 Replies

10. UNIX for Dummies Questions & Answers

Secondary DNS question

I have the primary set up, but cannot get the secondary box to answer a query. Here is the message I get: > nslookup dfwnet1 10.26.38.41 *** Can't find server name for address 10.26.38.41: Non-existent host/domain *** Default servers are not available 10.26.38.41 is the IP of the secondary... (3 Replies)
Discussion started by: 98_1LE
3 Replies
Login or Register to Ask a Question