Limiting a user to a script upon login, nothing else.


 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Limiting a user to a script upon login, nothing else.
# 15  
Old 02-03-2010
Hi,
Can someone tell me how to check how many times a unix server was stopped or started.

Thanks,
# 16  
Old 02-03-2010
SCO systems have a file /usr/adm/messages, that contains information for every time the system has been booted, as long as it hasn't been truncated.

Are you asking in general terms, or do you have a specific OS in mind?
# 17  
Old 02-03-2010
@reachdharem
Please start a new thread in a relevant forum. This thread is titled "Limiting a user to a script upon login, nothing else".
# 18  
Old 02-05-2010
@methyl,

Sure. I will do that. I am new here. Trying to adjust. Smilie
# 19  
Old 02-16-2010
Bug

Quote:
Originally Posted by ppucci
I have already on my script the exit commands to logout, but should the user break the script I still want him to be logged out or to return to the script, meaning I do not want him getting to the shell prompt by no means.
If you're worried about security then you'll need to be careful about what commands you use in your menu option.

If you're doing commands like:


echo "2 - Display something"
...
echo "5 - List some stuff"
echo "6 - Display system information"


You may be thinking to pipe multi-page output to less or more so the user can page through it.

A place I once worked had menu scripts that ran as root and paged files with less, which I found rather convenient when I needed a root shell on that box in an emergency... all I needed to do was go into the menu and choose the file viewer and type !<Enter> and I had a root shell!

If you read the less man page you will find:


When the environment variable LESSSECURE is set to 1, less runs in a "secure" mode. This means these features are disabled:
! the shell command
| the pipe command
:e the examine command.
v the editing command
s -o log files
-k use of lesskey files
-t use of tags files
metacharacters in filenames, such as *
filename completion (TAB, ^L)


That'll be something you'll want to export as a variable in the top of your script if you're going to use less.

When you try to lock something down your own way, using tools that weren't designed specifically for embedding in secure menus, you need to be smart enough to be able to second-guess everyone who will get access to the system, and shut off any loop-holes they could abuse before they find them.
# 20  
Old 02-19-2010
Code:
 
grep restart /var/adm/syslog

# 21  
Old 03-31-2010
@mikep9
Code:
grep restart /var/adm/syslog

That will only work if the sysadmin does not ever age syslog between reboots.

@reachdharam
What is the link to the new thread?

Overall listing O/S restarts depends on whether you elect to save the information. This could be in unix syslog files or in unix system accounting files. Unix is not M$ and unix servers which stay up for years are not unusual.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Login into another user from user inside script

now i have logged in username : ramesh in unix Now i have to created script file to login into another user and have run a command inside that user and after executing the command i have to exit from that user. Inside script, i have to login into su - ram along with password : haihow and have to... (4 Replies)
Discussion started by: rammm
4 Replies

2. 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

3. UNIX for Dummies Questions & Answers

Limiting User mailbox size in /var/spool

How can one limit the size of user mailboxes in /var/spool/mail? (0 Replies)
Discussion started by: proactiveaditya
0 Replies

4. UNIX for Dummies Questions & Answers

User login monitoring script.

Hi guys, I'm need to write a script that runs an infinite loop to check users that login/out of a server. I'm just not sure about the syntax with while loops and whether or not you can include a nested if-statement? Cheers Spaulds (2 Replies)
Discussion started by: Spaulds
2 Replies

5. Shell Programming and Scripting

Running script from other user rather than login user

Hi, My requirement is that i am login from ROOT in a script but when any command is coming which is logging to sqlplus then i have to run it with normal user as only normal user have permission to connect to sqlplus . i tried making a script like this : #! /bin/ksh su -... (3 Replies)
Discussion started by: rawatds
3 Replies

6. Shell Programming and Scripting

limiting data inputs for the user

if my user has to enter the name of months to carry out a search how can I limit the input values to only the month names and nothing else? so far my input criteria for the user is this: i would like it so the user can only enter the months in the way i have stated. otherwise they would... (11 Replies)
Discussion started by: amatuer_lee_3
11 Replies

7. Shell Programming and Scripting

login to different user completely within the script

I am trying to write a script where I would login to a userid with id and password while staying completely within the script. I am doing this in order to edit a file where I change permissions. The objective is to allow one user only to edit a file. This is what I have now. cd $HOME/data ... (1 Reply)
Discussion started by: yakdiver
1 Replies

8. AIX

Limiting length of user in while creating user

Hi all, I am a newbe to aix 5.2. I want to specify the characters used by users while creating user in aix like specifying the length of the password should i use some sript for that if it is then please let me know how to do this if yes give me the link for the scripts. Thanks in advance ... (2 Replies)
Discussion started by: Satya Mishra
2 Replies

9. Shell Programming and Scripting

User Login Monitor Script

I need some help writing a script that I can run as a cron job. I want this script to be able find all the users that have logged on to this machine since the last time the script was run (plan to run daily at 11:30pm, so everyone who logged on that day) and email me who logged on, and when. ... (2 Replies)
Discussion started by: Drewser
2 Replies

10. UNIX for Dummies Questions & Answers

user login script question

hi all, what file(s) needs to be changed and in what way in order to do the following: when user A logs onto freebsd 4.8 automaticaly he needs to start up a script a made that executes: sets ltp0 in polling mode, executes tn5250 keyboard mapping starts tn5250 with the correct parameters. ... (2 Replies)
Discussion started by: termiEEE
2 Replies
Login or Register to Ask a Question