LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2012, 05:21 AM   #1
collinv
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
problems with useradd


I am using what appears to be an outdated video tutorial on Linux as the step by step instructions are inconsistent with whats on ma screen. -using latest version of Kubuntu.

After using "su" to get to root i use "useradd" and then set passwd. But "ls" in home dir does not show the user added.

Using "cat /etc/passwd", a long list of stuff comes up and at the end i see the user i created in "home/xxx:/bin/sh" dir. The users i can see (which were created at desktop) with the "ls" command are under "home/xxx:/bin/bash" dir.

Using "useradd -D", shell is "SHELL=/bin/sh", which is different from the tutorial i am watching. When instructor does "useradd -D" command it is "SHELL=/bin/bash"

I'm guessing since the user i created in the terminal defaulted to "/bin/sh" instead of "bin/bash" they are segregated? If so...

1)What are the commands to ls users in "bin/sh" in the terminal? Furthermore, what is the difference between /sh and /bash?
2)How do I move these users to "/bin/bash"?
3)Is there a way to make adduser default to "/bin/bash" instead of "bin/sh"?

4)any recommendations for free absolute beginner linux videos/tutorials, as the one i am using appears to be outdated?

Apologies if post is redundant. Thanks in advance for any help!
 
Old 01-05-2012, 05:28 AM   #2
amilo
Member
 
Registered: Oct 2011
Location: Nederland
Distribution: Debian, Centos, Ubuntu
Posts: 80

Rep: Reputation: Disabled
With the command man useradd you can read all the options and default values you want.
 
Old 01-05-2012, 05:37 AM   #3
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by collinv View Post
1)What are the commands to ls users in "bin/sh" in the terminal? Furthermore, what is the difference between /sh and /bash?
there is no command to ls users in /bin/bash, this is the location of the shell binary, there are no users stored there. /etc/password, holds a list of all the users, and their relevant options. http://en.wikipedia.org/wiki/Compari...command_shells shows a comparison between different shells.
Quote:
2)How do I move these users to "/bin/bash"?
You dont, see above.
Quote:
3)Is there a way to make adduser default to "/bin/bash" instead of "bin/sh"?
to create a user using a different shell to the default, use the -s option. "man useradd" for more information
Quote:
4)any recommendations for free absolute beginner linux videos/tutorials, as the one i am using appears to be outdated?
http://lmgtfy.com/?q=absolute+beginner+linux+tutorials

I think you are misunderstanding the content of /etc/passwd. the colon is a delimiter between options for each user. If you are looking for the users home directory, it will be in /home/username, if its not, then most likely you didnt use the -m option when you added the user.
 
Old 01-05-2012, 05:49 AM   #4
rockstar05
Member
 
Registered: Dec 2011
Posts: 66

Rep: Reputation: Disabled
Hi collinv ,

to change the user shell just use option -s with the command useradd

example :

useradd -s /bin/bash <username>

and you know answer of the rest of the question.

thanks
 
Old 01-05-2012, 05:55 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by collinv View Post
I'm guessing since the user i created in the terminal defaulted to "/bin/sh" instead of "bin/bash" they are segregated? If so...
I am using RHEL and in mine default shell which is allocated is /bin/bash
Quote:
Originally Posted by collinv View Post
1)What are the commands to ls users in "bin/sh" in the terminal? Furthermore, what is the difference between /sh and /bash?
hit a search on google and you will find tons of websites explaining you the difference between all the shells
here is one from this bolg
http://www.linuxquestions.org/questi...bin-sh-693231/

Quote:
Originally Posted by collinv View Post
2)How do I move these users to "/bin/bash"?
Code:
#sudo usermod -s /bin/sh username
Quote:
Originally Posted by collinv View Post
3)Is there a way to make adduser default to "/bin/bash" instead of "bin/sh"?
Code:
#sudo useradd -s /bin/sh -d /home/directory username
Quote:
Originally Posted by collinv View Post
4)any recommendations for free absolute beginner linux videos/tutorials, as the one i am using appears to be outdated?
As per me lookout for CBTnuggets tutorials or you can easily purchase the video tutorials from http://cbtnuggets.com/ which I have used and I found them the best of all tutorials studied.
 
Old 01-05-2012, 07:52 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
On RHEL type systems, default settings are in /etc/default/useradd
 
Old 01-06-2012, 12:53 AM   #7
collinv
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for help! Got it worked out! -totally new to linux and command line interface in general. To a total neophyte, the man pages are far from illustrative. I sincerely appreciate the live support that these forums provide, and your patience for us nubs.
 
Old 01-06-2012, 01:01 AM   #8
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
If you got your answer mark the thread as "solved"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
odd useradd problems ninja master Slackware 4 12-10-2008 09:40 AM
Useradd - Cannot locate /etc/default/useradd in Solaris Paean Solaris / OpenSolaris 4 12-09-2005 02:36 AM
Password Problems With useradd Jude Lucien Debian 4 08-18-2005 11:44 AM
few problems (useradd, gDesklets) pureevil4 Slackware 4 04-12-2004 01:48 PM
useradd problems on RH 9.0 orenco Linux - Distributions 14 08-27-2003 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration