Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Limiting a user to a script upon login, nothing else. Post 302385290 by Corona688 on Thursday 7th of January 2010 05:51:21 PM
Old 01-07-2010
Quote:
Originally Posted by ppucci
And how can I set it to their login shell?? I mean, I can script but I understand little of the *NIX (Debian, for this matter) structure...

Appreciate you help!
Quote:
Originally Posted by jgt
Replace the shell in /etc/passwd with the name of the script.
Make sure that the script contains all the required path statements etc.
/etc/passwd is a text file that lists users and their login shells, among other things, one user per line.

Quote:
Originally Posted by Corona688
Depending on the system you may also need to add it to /etc/shells in order to allow it.
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
chsh(1) 						      General Commands Manual							   chsh(1)

NAME
chsh - change login shell SYNOPSIS
chsh [-D binddn] [-P path] [-s shell] [-l] [-q] [-u] [-v] [user] DESCRIPTION
chsh is used to change the user login shell. A normal user may only change the login shell for their own account, the super user may change the login shell for any account. If a shell is not given on the command line, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the field, or leave the line blank to use the current value. Enter none to remove the current value. The current value is displayed between a pair of [ ] marks. The only restrictions placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the super- user, and then any value may be added. An account with a restricted login shell may not change their login shell. This version of chsh is able to change the shell of local, NIS, NIS+ and LDAP accounts , if the permissions allow it. OPTIONS
-D, --binddn binddn Use the Distinguished Name binddn to bind to the LDAP directory. The user will be prompted for a password for simple authentica- tion. -P, --path path The passwd file is located below the specified directory path. chsh will use this files, not /etc/passwd. This is useful for exam- ple on NIS master servers, where you do not want to give all users in the NIS database automatic access to your NIS server and the NIS map is build from special files. -s, --shell Specify your login shell. -l, --list-shells Print the list of shells listed in /etc/shells and exit. -q, --quite Don't be verbose. -u, --usage Print a usage message and exit. --help Print a more verbose help text and exit. -v, --version Print version information and exit. FILES
/etc/passwd - user account information /etc/shells - list of valid login shells SEE ALSO
chfn(1), passwd(5), shells(5) AUTHOR
Thorsten Kukuk <kukuk@suse.de> pwdutils February 2004 chsh(1)
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy