Solved

Linux/Unix Shell

Posted on 2014-09-02
3
571 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will giveā€¦
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

726 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