Solved

Linux/Unix Shell

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now