Preventing switching shells


 
Thread Tools Search this Thread
Special Forums Cybersecurity Preventing switching shells
# 1  
Old 01-08-2009
Preventing switching shells

Hello,
My firm has a requirement that everyone must use bash. Of course, there can be exceptions so I do not want to disable the other shells. But is there a way that I can prevent users from switching to another shell?

Thank you.
# 2  
Old 01-08-2009
You can disable access to chsh. But that will never stop somebody from changing the shebang line in a script. If you already have production and startup scripts in bourne shell or ksh or whatever you cannot deny access to those shells.

Can you more clearly define what you want to acheive? What OS are we talking about here?
# 3  
Old 01-08-2009
Certainly, as best as I can.

The firm decided simply to restrict everyone to the bash shell for "security" reasons. It is a small enough firm that they might be able to get away with it, but it would be nice to enforce it. They have documented it as policy, but they would like to have something a bit more strict, forcing everyone to only use bash. I was not sure that it could be done but I figured that I would ask.
# 4  
Old 01-08-2009
It can be done. Not a great idea on production machines.

Assuming there are no production or system scripts written in anything but /bin/sh or bin/bash (and /bin/sh is a symlink to bash), make all of the "other" shells symlinks to /usr/bin/bash. /bin/sh should also ALREADY be a link to /bin/bash, ie the system boots up error-free using bash. If it is not - do not do this.

Restrict access to /usr/bin/chsh - deny other execute. The only other problem is somebody using passwd -s to change shells. All that will happen there is they will "change" to bash anyway.

None of this is a great idea. There could be scripts somewhere that depend on ksh wierdness and you just broke them, for example. I am also not convinced about security concerns unless there are shells that some user downloaded off the net on your box somewhere. You may want to et rid of those anyway whether or not you can lock down to bash-only.
# 5  
Old 01-08-2009
Thank you. I just wanted to mention (since I left it off before) that we are talking about Solaris machines.

I agree with you about not seeing the security advantage here, but I figured that I would research it and be prepared for that possibility.
# 6  
Old 01-22-2009
The current default shell on Solaris is the Bourne shell. All the startup scripts depend on it. If you are going to change it to bash, you need to test your startup and shutdown scripts carefully.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Preventing Opera browser VPN

A fight against open-access I'm afraid. Opera Software have published their latest browser boasting built in free VPN giving access past firewalls of countries, companies, education establishments etc. Free VPN | Now built into Opera browser As one on the other side of the fence trying to... (1 Reply)
Discussion started by: rbatte1
1 Replies

2. Shell Programming and Scripting

Preventing the sleep mode in Solaris

Hi , I am working on a Solaris server which goes to sleep mode if idle for more than 30 min. I have a remote access so that I can access the server from my home too. By the time I go back to my room, it is going to sleep mode so I could see nothing but a black screen. Is there any option to... (3 Replies)
Discussion started by: prabhag
3 Replies

3. Shell Programming and Scripting

Switching between shells

I don't know why, but it just isn't working how I want it to work. You might want to run it to see what I mean. Or you might be a genius (or just really good at unix) and know just by looking at it what the problem is. Have fun trying to figure this one out.:wall: (11 Replies)
Discussion started by: nowruzr
11 Replies

4. UNIX for Advanced & Expert Users

Preventing script to run at the same time.

I have a script, myscript.pl I want to set the script to exit if it is already running. At the moment I am using soft stop. eg: if -e dummy file then exit else create a dummy file Is there any other better way to perform this? Maybe ps -ef | egrep 'myscript.pl' (3 Replies)
Discussion started by: cronboss
3 Replies

5. Solaris

preventing the banner from being shown

Is there a way to supress the banner from being shown when you log in? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

6. UNIX for Advanced & Expert Users

Preventing passwd root?

I knew it would happen sooner or later.... We have a requirement that specific individuals need "sudo root" authority. I knew it only a matter of time before someone decided to change the root password (at least they owned up to it). Now the question is how can I grant all rights except... (4 Replies)
Discussion started by: scottsl
4 Replies

7. Shell Programming and Scripting

Switching shells in UNIX Scripts

Solaris Newbie here to scripting in UNIX/SOLARIS. What I am looking to do is, once the script is executed, switch to /bin/bash shell and continue to execute the script. The problem I run into is once the script switches to the Bash shell, the script stops, and does not execute the... (2 Replies)
Discussion started by: Scoobiez
2 Replies

8. UNIX for Advanced & Expert Users

preventing others to run processes on my machine

I am in a multi-user Linux environment at work. Other users easily run processes on my machine when my machine is idle, but when I try to use my machine, it is dead slow. The processes run by them always grab the top spot using 99% of my CPU time. Is there a way I can prevent others to run... (3 Replies)
Discussion started by: besharam
3 Replies

9. Linux

Preventing a scan of the RAID during bootup

I have a RH 7.3 server that needs a restart today after putting a patch in place. The last time I rebooted this box was almost a year ago and when the uptime is quite long, Linux likes to check all the disks for errors, including the RAID. This adds almost 1.5Hrs to my bootup process:eek: . Does... (1 Reply)
Discussion started by: turbo90awd
1 Replies

10. UNIX for Dummies Questions & Answers

switching shells??

Hi How can i switch shells on linux and freebsd? i tried changing the passwd file and restarted the computer but i still get the same old shell. anybody has the answer? thanks (6 Replies)
Discussion started by: xNYx
6 Replies
Login or Register to Ask a Question