The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Ubuntu
.
google unix.com



Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
features of a new SHELL nsharath Shell Programming and Scripting 15 02-06-2009 04:54 AM
Ubuntu 8.10 Server Edition delivers significant new features to innovative user base iBot Security Advisories (RSS) 0 10-27-2008 12:20 AM
Shell features ??? skyineyes UNIX for Dummies Questions & Answers 1 05-28-2008 07:00 AM
setting password for user using useradd? zedex UNIX for Advanced & Expert Users 1 10-21-2007 12:21 PM
Who can help me how to add user without 'useradd' command foong UNIX for Dummies Questions & Answers 3 08-07-2003 02:02 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2009
ktm ktm is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 12
useradd - shell missing features after adding user

Hi, I need to create a user from a bash script so i have to use useradd. The problem is that when i create a user with:

Code:
useradd -d /home/sample -m sample

after i login with that user I have no history in bash, path do not appears, i can't use arrows and so on. When I use adduser everything is fine but what I'm missing here ? What parameters do i have to use with useradd so when I login with that user bash has full features.

Thank you.
  #2 (permalink)  
Old 09-11-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 366
try usermod -s /bin/bash <username> if the shell is not bash, for some reason. Alternately check to make sure the contents of /etc/skel were copied to the user's home.
  #3 (permalink)  
Old 09-23-2009
lzcool lzcool is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 13
useradd does not give the user any more parameters than those you create, so the way you're using it, it won't asign bash as the default shell.

I'd use this:
useradd -d /home/user -s /bin/bash -G group -m user

Remove the -g in case you don't want him to be in a specific group.
I'd try adding a -p password with a password that might be maybe the same user name

Good luck
  #4 (permalink)  
Old 09-23-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 366
if you use the -G group that will be a secondary group. If you want them to be in default groups, then you can leave that off. Otherwise, use -G for groups you don't want to include their primary GID. -g is used for their primary GID/group.
  #5 (permalink)  
Old 09-24-2009
solaris_user solaris_user is offline
Registered User
  
 

Join Date: Aug 2009
Location: Croatia
Posts: 115
useradd -d /home/user -m -s /bin/bash -c "Name&Surname" user

this will create new user

then
passwd user --> enter new password

then transfer owneship to new user

chown -R user /home/user
  #6 (permalink)  
Old 09-24-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 366
ownership should not need transferring when made with useradd especially if the -m switch is used.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0