User Logging

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting User Logging
# 1  
Old 01-31-2014
User Logging


I have several engineers logging into servers with the same system username and passwords eg root. I was thinking about adding a script to bashrc where a user is forced upon login to enter their name and once that has executed there history is logged/redirected to a log file somewhere. I have googled the hell out of it, but running into problems trying to activate the history only for that users session.

Actually I don't know best approach for this any guidance welcomed.
# 2  
Old 01-31-2014
Disallow direct root login and force users to login with their userid and su or sudo -i to root.
# 3  
Old 01-31-2014
This is true I can disable root no problem but that is not the issue. I may have 5-10 engineers acessing a system under 3 usernames /day. Its impossible to create usernames for them all (30-40/ month). I just need a way to force them to log their name abd redirect their commands to a file.
# 4  
Old 02-01-2014
We call this: login with user name and su and sudo.

Works for 100s of users per server at many thousands of companies.
# 5  
Old 02-03-2014
If someone signs in as root then they could fiddle the local logs in any case unless you write them to a remote syslog collector that the engineers do not have access to.

You have no audit on who is using your system. Using sudo really is the way to go as a starter, but don't grant them access to switch user to root. Work out what they need to do, then grant them the privileges to do that and nothing else.

Do not let them run anything as root that you can escape to a shell with, e.g. ftp, vi or even bash as then they have full access again.

It pays to be paranoid about the root account. Protect it else you as the owner will get the blame for everything and anyone could make a costly or fatal mistake on your server. They may complain that they can't do their job, but that's where you have to negotiate and get them the privileges they need and nothing more.

# 6  
Old 02-03-2014
Originally Posted by maxwellhouse

I have several engineers logging into servers with the same system username and passwords eg root.
If you give them root, you have lost all control.

Perhaps a script to create users would help.
# 7  
Old 02-03-2014
If you want multiple users to use the same account, but also have logs to see which IPexecuted each command is possible.

You need to add some entries in bashrc and in addition to add some extra scripts under home directory, the final result will be like:

pts_0 [2011-10-26 16:29:04] sudo apt-get install putty
pts_0 [2011-10-26 16:29:04] ls -ltrh
pts_1 [2011-10-26 16:29:04] ssh tom_cat01
pts_3 [2011-10-26 16:29:04] cd /tmp
pts_1 [10-26-2011_17:05:39] shutdown -r now

Using last command in addition you can find also which IP was pts_1 at 10-26-2011_17:05:39 and rebooted the node.
Let me know if you need something like this. I can send you the scripts to give a try.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Syslog not logging successful logging while unlocking server's console

When unlocking a Linux server's console there's no event indicating successful logging Is there a way I can fix this ? I have the following in my rsyslog.conf /var/log/secure /var/log/secure (1 Reply)
Discussion started by: walterthered
1 Replies

2. UNIX for Dummies Questions & Answers

User account logging

Hi - I want to log commands typed by oraapps user with time into some log file on runtime. HISTTIMEFORMAT="%d/%m/%y %T " works but any one with oraapps user can delete the history. OS : RHEl 5.6 Any help is appreciated. (5 Replies)
Discussion started by: oraclermanpt
5 Replies

3. UNIX for Advanced & Expert Users

Logging User Sessions

Hello, I am using a Linux server (Ubuntu 11.04 Server) to host some files and a code repository. Because we are using ssh + svn to connect to the repository, our users have normal ssh access. What I would like to do is log their user sessions so that I have an audit trail in the event that... (2 Replies)
Discussion started by: chrisb1609
2 Replies

4. UNIX for Dummies Questions & Answers

How to avoid logging with root user?

I have created a linux machine and installed some softwares on it with root user privileges . I used to login with root user credentials for doing the various task. Later i have realise that this is not the best practice to follow and there should be a new user with less privileges to be created... (1 Reply)
Discussion started by: pinga123
1 Replies

5. Post Here to Contact Site Administrators and Moderators

Constant Logging In (After Logging Out)

Hi Everyone. First, I want to thank all of you for letting me participate in this great group. I am having a bit of a problem. After I get an email from a responder, I login to make my reply. In the mean time I get another response by email from another member, I go to reply to them and I... (6 Replies)
Discussion started by: Ccccc
6 Replies

6. AIX

Logging user logins

I want to know how I can turn off and turn on login logging. We have a server that appears to have stopped logging user logins. Running the who command shows nothing and the last command shows no logins for a month. The var/adm/wtmp file isn't full and there is plenty of space in the var file... (2 Replies)
Discussion started by: daveisme
2 Replies

7. UNIX for Dummies Questions & Answers

Possibility of logging into linux machine when the user does not exist locally

Hi, I am trying authenticate ssh users login using third party server (radius) instead of local system authentication. I have modified my /etc/pam.d/sshd with required server auth configuration and able to authenticate user using radius server and the user is able to ssh into this linux... (2 Replies)
Discussion started by: dhandapanik
2 Replies

8. HP-UX

Issue with user logging in to HP UX Server

Hi, I wonder if anyone is able to assist me. I have a HP UX server and some HP UX workstations that has been migrated from another network. I have changed the IP Addresses and everything seems to be working fine. However, the users are complaining that they are unable to login to the UX... (1 Reply)
Discussion started by: michaelgim
1 Replies

9. Solaris

Tracing a user and logging his actions

Dear All, I want to enable the tracing for a user and logging all things he do in a log file.......... Thaaanks (2 Replies)
Discussion started by: adel8483
2 Replies

10. UNIX for Advanced & Expert Users

User logging log

Hi, Does anybody knows is there a way or how to records user logging record? thanks in advance (4 Replies)
Discussion started by: jennifer
4 Replies
Login or Register to Ask a Question