Sponsored Content
Top Forums Shell Programming and Scripting On korn shell, how to share history between regular user and root? Post 303027845 by DevuanFan on Wednesday 26th of December 2018 12:24:53 PM
Old 12-26-2018
On korn shell, how to share history between regular user and root?

I'm exploring OpenBSD and want to stick to its default shell, which is ksh. My goal is for my regular user ("bruno") and root user to have a shared history file. However, it seems that when running as root, ksh refuses to write to a HISTFILE that is owned by non-root user. This illustrates the issue:



Code:
$ echo $0
  ksh
$ HISTFILE=/home/bruno/history  
$ chmod 777 /home/bruno/history
$ echo test
  test
$ cat /home/bruno/history
  chmod 777 /home/bruno/history
  echo test
  cat /home/bruno/history
$ su
 Password:
# HISTFILE=/home/bruno/history
# echo $HISTFILE
  /home/bruno/history
# echo test2
  test2
# cat /home/bruno/history
  chmod 777 /home/bruno/history
  echo test
  cat /home/bruno/history
  su

As you can see, the commands that are run as root do not appear in /home/bruno/history. Why won't root session in ksh write to the specified HISTFILE? If it is a ksh security feature, how do I turn it off?

Last edited by DevuanFan; 12-26-2018 at 02:46 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

korn shell script to keep history of same file

Hello, How do I write a korn shell that will rename file with the current date. What I want to do is, I have a file that is re-written every day. But instead, I want to keep a 14 day history of the file. So I want to write a script that will rename the current file with a date attached to the... (2 Replies)
Discussion started by: watson2000
2 Replies

2. Shell Programming and Scripting

access user history as root

Hi, I need to access a user's command history. However, the dilemma is that he is logged in and so his current history is not yet flushed to .bash_history file which gets flushed when he logs out. Is there a way I can still access his most recent history? thank you, S (4 Replies)
Discussion started by: sardare
4 Replies

3. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

4. Shell Programming and Scripting

Shell script for to view all users & groups history in root

Dear All, I want to know all users & group history in one file, for root terminal through shell or any other option (5 Replies)
Discussion started by: kpoobathi
5 Replies

5. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

6. Shell Programming and Scripting

Korn Shell regular pattern

Hello, I can't seem to understand korn shell regular expression. I am trying to extract the tagfrom its own filename string. var="LNX_1.2.0.0.af329a3da.tar" whereby af329a3da is the tagI am trying to extract out from. I am trying to avoid using IFS because future modifications... (5 Replies)
Discussion started by: howhan
5 Replies

7. Shell Programming and Scripting

How to Login as another user through Shell script from current user[Not Root]

Hi Every body, I would need a shell script program to login as different user and perform some copy commands in the script. example: Supppose ora_toms is the active user ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands ... (9 Replies)
Discussion started by: ujjwal27
9 Replies

8. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

9. Shell Programming and Scripting

script to get user id reports korn shell

Dear Friends, Can Any one provide me script to generate list of username with the gecos field. (cat /etc/passwd | cut -d: -f1,5) Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command) and i want a file to be generated on nim... (1 Reply)
Discussion started by: vinodchauhan123
1 Replies

10. Shell Programming and Scripting

How to Switch from Local user to root user from a shell script?

Hi, I need to switch from local user to root user in a shell script. I need to make it automated so that it doesn't prompt for the root password. I heard the su command will do that work but it prompt for the password. and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies
FLAMEROBIN(1)						   Firebird Administration Tool 					     FLAMEROBIN(1)

NAME
flamerobin -- management and data manipulation tool for the Firebird DBMS SYNOPSIS
flamerobin [-h directory | --home=directory] [-uh directory | --user-home=directory] DESCRIPTION
flamerobin is a graphical frontend to the Firebird DBMS. It is small and simple, yet offers all the basic features needed to create and manipulate databases, execute queries and perform administrative tasks. This manual page only documents the run-time options and environment of flamerobin. Information about using the GUI may be obtained by selecting the Help -> Manual menu item once the application is running. flamerobin uses two directory hierarchies for its normal operation. The data directory contains the templates for property pages, the default configuration and the on-line documentation grouped into three sub-directories as follows: conf-defs default configuration docs on-line documentation html-templates templates for property pages The user home directory contains the per-user configuration, comprising three entries: fr_databases.conf this file stores the user's registered databases. fr_settings.conf this file stores the user's preferences related to the flamerobin GUI. history this directory holds the SQL statement history, one item per file. flamerobin accepts several options, which are described as follows: -h directory --home=directory Use directory as the data directory (but see ENVIRONMENT below). -uh directory --user-home=directory Use directory as the user home directory (but see ENVIRONMENT and CAVEATS below). ENVIRONMENT
FR_HOME Specifies an alternate location for the flamerobin data directory. If both -h (or --home) and this environment variable are set, the command line argument takes precedence. FR_USER_HOME Specifies an alternate location for the flamerobin user home directory. If both -uh (or --user-home) and this environment variable are set, the command line argument takes precedence. FILES
/usr/share/flamerobin The default flamerobin data directory. ~/.flamerobin The default flamerobin user home directory. AUTHORS
flamerobin was written by The FlameRobin Development Team <http://www.flamerobin.org/>. CAVEATS
flamerobin only writes files under the user home directory. If flamerobin is configured so that this directory and the files contained therein are shared among several users or concurrent instances of flamerobin, no precaution is taken to avoid overwriting settings created by other users or other application instances. NOTES
The specification of the data directory and the user home directory (regardless of whether they occur in the environment or on the command line) may be the literal string ``$app'' which translates to a common data folder determined at compilation time, or ``$user'' which trans- lates to the user local data directory. These options currently have effect only on Windows platform. FlameRobin 0.7 April 12, 2006 FlameRobin 0.7
All times are GMT -4. The time now is 02:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy