Solved

Linux/Unix Shell

Posted on 2014-09-02
3
579 Views
Last Modified: 2014-09-18
hi,

Is there an easy way to set yourself to use bash shell by default?  Also, how can you tell what shell is set as the default?
0
Comment
Question by:Jack_son_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Assisted Solution

by:nemws1
nemws1 earned 250 total points
ID: 40300133
The default shell for a user is determined by their entry in the /etc/passwd file.  A typical entry looks like this:

joe:x:10000:100:Joe Schmoe:/home/joe:/bin/bash

This info is colon separated and is as follows:

Username
Encrypted Password (an 'x' means the encrypted data is stored in /etc/shadow instead of /etc/passwd)
Numeric User ID (UID)
Default Group ID (users can be in multiple groups, but must belong to at least one.  This will match a corresponding entry in /etc/group)
User's full name
Default home directory
Default shell

Many variants of UNIX can store this in various ways.  You *can* edit this file directly, but beware, if you mess it up, you might not be able to log in again.

Depending on which Linux distribution you are running, it would probably be easier for you to use a built-in user editor or user manager.  Which distro and/or Graphical interface (KDE, Gnome?) are you using?
0
 
LVL 84

Expert Comment

by:ozo
ID: 40300218
chsh -s /bin/bash
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 250 total points
ID: 40300229
If root is using useradd to add / create user names / accounts then the useradd will take defaults from the file /etc/default/useradd. You can edit the file and change default shell there.

For existing users you can edit /etc/passwd file and change the login shell for each user (last field)

or

use the command

usermod -s /bin/bash username
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question