?
Solved

Linux/Unix Shell

Posted on 2014-09-02
3
Medium Priority
?
584 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 1000 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 1000 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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