Changing Default Shell

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Changing Default Shell
# 1  
Old 03-14-2009
Question Changing Default Shell

I bought a used MacBook G4 with Tiger 10.4.11
Running fine, then I noticed a few things were missing.
I don't have Terminal or Netinfo Manager in my Utilities!
I downloaded iTerm, but for some reason my shell is set to /dev/null
I know I can change my shell using Netinfo Manager, but I don't have that either!
The only command line interface I have is through single-user mode...
Thanks in advance.
# 2  
Old 03-15-2009
This works with Mac OS X 10.4.11:

Quote:
[~] # niutil -read / /users/frozentin|grep "shell"
shell: /bin/bash <--- I removed this below
[~] #
[~] # niutil -destroyval / /users/frozentin "shell" "/bin/bash" <---- this is the value of "shell" from above command
[~] # echo $?
0
[~] # niutil -insertval / /users/frozentin "shell" "/bin/ksh" 0 <---- Here "0" is the index. You want a known good shell at "0".
[~] # echo $?
0
[~] # niutil -read / /users/frozentin|grep "shell"
shell: /bin/ksh
[~] #
Take a look at these search results: http://www.google.com/search?q=niutil+-createprop+.

Take a look at this link: How do I change my default shell in Mac OS X Panther from tcsh to bash? :: Free Tech Support from Ask Dave Taylor!

Advise from Apple Support: http://support.apple.com/kb/TA27005?viewlocale=en_US

Another, from MacOSHints: http://www.macosxhints.com/article.p...20213084259198

Last edited by frozentin; 03-15-2009 at 03:15 PM.. Reason: Added niutil commands.
# 3  
Old 03-15-2009
10.4.11 has support for the recent change to ds, or directory services commands that 10.5.x uses. 10.5 has no NetInfo support.

As a suggestion, you'll probably want to start using the ds commands going forward.

Some of the commands:
dscl . -list /Users
dscl . -read /Groups/admin
dscacheutil -flushcache
...
# 4  
Old 03-15-2009
Quote:
Originally Posted by frozentin
Thanks...will this work even if my current shell is set to /dev/null?
# 5  
Old 03-19-2009
No. You will need to be logged in as a user that has a shell and has admin privileges.

If you do not have NetInfo Manager, and your terminal is set to /dev/null your user account is dead in the water with regard to launching a terminal session.

You could try adding an admin user account to your machine, logging in as that new user and changing the settings for your normal account. If a default of /dev/null is set for new accounts, then that won't help.

You could try booting into single user mode (start up with the command and "s" keys held down, and try changing it from there.

Otherwise, you will probably need to acquire a copy of OS X, then reinstall the OS.

Good luck!
# 6  
Old 04-26-2009
There is a somewhat obtuse graphical interface in which you can change a user's shell.

In System Preferences, click on Accounts. Then hold down the control key and click on the user account. You will get a selection for Advanced Options, and you can change the shell, among other things.

You probably need to be an administrative user to do that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing shell from a script and running something from the new shell

Hi We use "tcsh" shell . We do the following steps manually: > exec ssh-agent zsh > python "heloo.py" (in the zsh shell) I am trying to do the steps above from a shell script This is what I have so far echo "Executing " exec ssh-agent zsh python "hello.py" exit 0 Problem is... (5 Replies)
Discussion started by: heman82
5 Replies

2. HP-UX

Changing default shell to bash

According to multiple sources you should not change the default shell to bash for the root user because it will make the system unbootable. Is there a safe way to launch bash for root when logging in? Perhaps I can edit /etc/profile or add it to a startup script somewhere? (2 Replies)
Discussion started by: bstring
2 Replies

3. Shell Programming and Scripting

changing a shell

i have created users but those are not listing in HOME directory...and i want to change a shell to another shell...can any one reply me with solutions.. (4 Replies)
Discussion started by: potu@123
4 Replies

4. Shell Programming and Scripting

Changing from one shell to another

Hi all,I installed cent OS in my machine. Now when i open the terminal and start writing some commands, then by default with which shell i am working with? Will i be able to change the shell and then run a few commands? if possible then how to change the shell? Please reply Thank you (8 Replies)
Discussion started by: gautamshaw
8 Replies

5. UNIX for Dummies Questions & Answers

changing shell???

hi guys I have a user that has been used for long time now that runs o C Shell... now there is a need to change it to Bash Shell? Can I cause a problem changing his shell from C to bash? I mean apps or variables? thanks a lot (3 Replies)
Discussion started by: karlochacon
3 Replies

6. Shell Programming and Scripting

Changing the shell prompt

Hi, I want to change the shell prompt, using the cd command. I have a shell prompt like this - p78-mfx(dgaw1078/9781)$ Now i do this - p78-mfx(dgaw1078/9781)$ cd log4j here the shell prompt should change like this - p78-mfx(dgaw1078/9781)log4j$ (6 Replies)
Discussion started by: arunkumarmc
6 Replies

7. UNIX for Dummies Questions & Answers

Changing default login shell

Hi everybody, The problem is quite simple, I want to change my default shell which is /bin/csh to /bin/bash. I have looked online for solutions to my problem, but to no avail. I have tried chsh, but it tells me this: chsh: can only change local entries; use ypchsh instead. I use ypchsh,... (7 Replies)
Discussion started by: z1dane
7 Replies

8. Shell Programming and Scripting

changing shell while using ssh

Hello, I am trying to ssh to a remote machine then change the shell and execute the script. However the ssh session hangs when i try to change the shell ssh user@host 'csh ; source /home/cshProfile; $HOME/exec.sh' if i do ssh user@host ' $HOME/exec.sh' This works however i... (2 Replies)
Discussion started by: amit1_x
2 Replies

9. Shell Programming and Scripting

Regarding changing shell thru script

Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine. Or please suggest other alternative if any??? #!/bin/ksh HOST=`hostname` echo "Running the script..." for MyServer in `cat ServerNames.txt` do echo "\n Logging onto... (4 Replies)
Discussion started by: sdosanjh
4 Replies

10. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies
Login or Register to Ask a Question