Automatically change to Bash shell after login


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automatically change to Bash shell after login
# 1  
Old 12-24-2008
Automatically change to Bash shell after login

Hi men,

I think this must be a very common job. "How could to Automatically change to Bash shell after login and then jail user can only using this shell".

I want monitor user works.However it just only effect on Bash shell. Consequently if the user change the shell it will be worthless.

As i remember there's a topic mention about this but i cannot find it again. So i recreate a new topic. Please help me. THank for reading!
# 2  
Old 12-24-2008
A users default shell can be changed using the chsh command. It should only accept shells listed in /etc/shells. Remove any shells from /etc/shells that you don't want users accessing.

Not all unix systems enforce the use of shells from /etc/shells by default. It's a configurable option on most systems. You'll have to read up on your flavor of unix to find out how it implements this functionality.

You will also have to remove execute permissions from any shells you don't want users running.

Last edited by stanleypane; 12-24-2008 at 12:45 PM..
# 3  
Old 12-26-2008
my system that i working on is Solaris ... there's no /etc/shells file

On Solaris, after type "bash" the shell change to "bash shell", but people can easily change by typing "exit"
# 4  
Old 12-26-2008
Quote:
Originally Posted by tien86
my system that i working on is Solaris ... there's no /etc/shells file

On Solaris, after type "bash" the shell change to "bash shell", but people can easily change by typing "exit"
set the users default shell in "/etc/passwd".
# 5  
Old 12-26-2008
Hi.

See man shells on Solaris 10; passwd -e changes shell; man vipw to see how to edit passwd file directly. The file /etc/shells is consulted by utilities, but if it does not exist, then a few other places are checked -- again man shells for details ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change directory within a bash shell script

Hi, I have been trying to execute the below command by changing directory and then copying contents of one directory to another by doing some file name manipulations in between. However this isnt working since as soon as the statement completes it goes back to the original folder. Can someone... (5 Replies)
Discussion started by: HikingLife
5 Replies

2. Solaris

Run automated bash commands from sh login shell

I use plink.exe to automate remote commands that return data to Windows machines. This works well on newer servers running Red Hat since the commands were developed for bash and the designated user's login shell is bash. I need to also support older servers which are running Solaris 10 but the... (5 Replies)
Discussion started by: randman1
5 Replies

3. UNIX for Dummies Questions & Answers

Which of the following command displays your login shell in bash shell?

Options:: A)$shell B)echo $ bash C)echo $ O D)$ O (1 Reply)
Discussion started by: raghugowda
1 Replies

4. Shell Programming and Scripting

Help with Unix bash shell script login

Hi, I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Discussion started by: tdsrogers
0 Replies

5. Shell Programming and Scripting

automatically format Shell Script (bash)

Hi In TOAD I can write SQL code, then select the SQL code -> Menu Edit -> Format Code The output is well formatted code (correct indent, ...) Is there a tool (for Windows and/or UNIX) what can do the same for bash code? TOAD (software) - Wikipedia, the free encyclopedia (1 Reply)
Discussion started by: slashdotweenie
1 Replies

6. Shell Programming and Scripting

How to change your default login shell.

I am new to UNIX hence the question. Most of the time when I have an environment set up for me to develop my systems, I have had my ID logon and I can edit the .profile for my account and it understand commands korn shell. It seems this machine, a new SUN machine, was setup with users getting the... (3 Replies)
Discussion started by: klarue7
3 Replies

7. UNIX for Dummies Questions & Answers

Change the default shell from bash to ksh

Currently my default shell is bash.How can i change itto ksh... (2 Replies)
Discussion started by: dr46014
2 Replies

8. Shell Programming and Scripting

how to change shell from BASH to C

hi all, how can i change my shell from BASH to C shell? i am using cygwin. (3 Replies)
Discussion started by: npatwardhan
3 Replies

9. UNIX for Advanced & Expert Users

Can we launch a shell script automatically upon ssh login?

Greetings all, I'll just like to know if it is possible to launch a shell script automatically upon a user's successful login into ssh from a remote host, without adding a command parameter to the ssh command... ie. after keying in ssh username@host (not ssh username@host "command") and upon... (1 Reply)
Discussion started by: rockysfr
1 Replies

10. Solaris

How to get bash to be the login shell?

Is there a way to edit a .profile file that would let a user have bash as their login shell? We tried adding: exec /bin/bash --login to the .profile, but this produced an endless loop and we could not login using that account. Thanks! Aaron (8 Replies)
Discussion started by: amheck
8 Replies
Login or Register to Ask a Question