Solved

Linux/Unix Shell

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

786 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