LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems with useradd (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-useradd-922169/)

collinv 01-05-2012 04:21 AM

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!

amilo 01-05-2012 04:28 AM

With the command man useradd you can read all the options and default values you want.

fukawi1 01-05-2012 04:37 AM

Quote:

Originally Posted by collinv (Post 4566679)
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.

rockstar05 01-05-2012 04:49 AM

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

deep27ak 01-05-2012 04:55 AM

Quote:

Originally Posted by collinv (Post 4566679)
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 (Post 4566679)
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 (Post 4566679)
2)How do I move these users to "/bin/bash"?

Code:

#sudo usermod -s /bin/sh username
Quote:

Originally Posted by collinv (Post 4566679)
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 (Post 4566679)
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.

chrism01 01-05-2012 06:52 PM

On RHEL type systems, default settings are in /etc/default/useradd

collinv 01-05-2012 11:53 PM

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.

deep27ak 01-06-2012 12:01 AM

If you got your answer mark the thread as "solved" :)


All times are GMT -5. The time now is 05:23 AM.