I have something not right on my xubuntu 8.10 system. When I create new users using 'useradd <username> they are created OK but don't get a home directory. I'm sure the default used to be to create a home directory and to copy its contents from /etc/skel but it's not doing that. If I do 'useradd -m <username>' then I get the files copied from /etc/skel but they don't get executed on logging in to the new account.
Even if I log in to the newly created user and try and execute the files I get a really odd error message:-
$ . .profile .: 13: .profile: not found $
The file .profile does exist:-
$ ls -al total 32 drwxr-xr-x 5 isbd isbd 4096 2008-12-21 20:23 . drwxr-xr-x 10 root root 4096 2008-12-21 20:24 .. -rwxr-xr-x 1 isbd isbd 220 2008-05-12 19:49 .bash_logout -rwxr-xr-x 1 isbd isbd 3115 2008-05-12 19:49 .bashrc drwx------ 5 isbd isbd 4096 2008-12-19 20:13 Mail drwxr-xr-x 2 isbd isbd 4096 2008-12-19 20:11 .mutt drwxr-xr-x 25 isbd users 4096 2008-10-07 19:20 oldIsbd -rwxr-xr-x 1 isbd isbd 675 2008-05-12 19:49 .profile
Erk! What have I done? :-)
Existing users work fine.
On 21-Dec-08 21:01:57, Chris G wrote:
I have something not right on my xubuntu 8.10 system. When I create new users using 'useradd <username> they are created OK but don't get a home directory. I'm sure the default used to be to create a home directory and to copy its contents from /etc/skel but it's not doing that. If I do 'useradd -m <username>' then I get the files copied from /etc/skel but they don't get executed on logging in to the new account.
Even if I log in to the newly created user and try and execute the files I get a really odd error message:-
$ . .profile .: 13: .profile: not found $
The file .profile does exist:-
$ ls -al total 32 drwxr-xr-x 5 isbd isbd 4096 2008-12-21 20:23 . drwxr-xr-x 10 root root 4096 2008-12-21 20:24 .. -rwxr-xr-x 1 isbd isbd 220 2008-05-12 19:49 .bash_logout -rwxr-xr-x 1 isbd isbd 3115 2008-05-12 19:49 .bashrc drwx------ 5 isbd isbd 4096 2008-12-19 20:13 Mail drwxr-xr-x 2 isbd isbd 4096 2008-12-19 20:11 .mutt drwxr-xr-x 25 isbd users 4096 2008-10-07 19:20 oldIsbd -rwxr-xr-x 1 isbd isbd 675 2008-05-12 19:49 .profile
Erk! What have I done? :-)
Existing users work fine.
-- Chris Green
Have a look at /etc/default/useradd (if it's there ... ) to see what defaults it offers. Also, you might consider using /sbin/adduse instead of useradd -- this is quite a sophisticated script which calls useradd at various points.
Check the options for useradd in 'man useradd'.
Maybe Ubuntu prefers people to use some system admin widget from the graphical menu, and hasn't set up the command-line approach properly.
Good luck! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 21-Dec-08 Time: 21:24:11 ------------------------------ XFMail ------------------------------
On 21/12/2008 21:24:13, Ted.Harding@manchester.ac.uk wrote:
Have a look at /etc/default/useradd (if it's there ... ) to see what defaults it offers. Also, you might consider using /sbin/adduse instead of useradd -- this is quite a sophisticated script which calls useradd at various points.
According to the man page for useradd on Debian they would rather people used adduser instead.
Regards, Steve.
On Sun, Dec 21, 2008 at 10:43:28PM +0000, Steve Fosdick wrote:
On 21/12/2008 21:24:13, Ted.Harding@manchester.ac.uk wrote:
Have a look at /etc/default/useradd (if it's there ... ) to see what defaults it offers. Also, you might consider using /sbin/adduse instead of useradd -- this is quite a sophisticated script which calls useradd at various points.
According to the man page for useradd on Debian they would rather people used adduser instead.
Yes, I have since discovered that. It works OK too. I'm sure I've used useradd without problems previously though. Oh well, never mind.
On 22 Dec 2008, at 11:13, Chris G wrote:
Yes, I have since discovered that. It works OK too. I'm sure I've used useradd without problems previously though. Oh well, never mind.
Maybe you gave it the right options last time you used it?
On Mon, Dec 22, 2008 at 11:18:59AM +0000, David Reynolds wrote:
On 22 Dec 2008, at 11:13, Chris G wrote:
Yes, I have since discovered that. It works OK too. I'm sure I've used useradd without problems previously though. Oh well, never mind.
Maybe you gave it the right options last time you used it?
My memory (which may be failing of course) was that I just used to do "useradd <username>" and I got the basic set-up of a new user.
I have to say that I used to edit the password file directly (using vipw if I was being good) and that was actually quite straightforward. One had to create the home directory as well of course but it's hardly difficult.
On 22-Dec-08 13:26:10, Chris G wrote:
On Mon, Dec 22, 2008 at 11:18:59AM +0000, David Reynolds wrote:
On 22 Dec 2008, at 11:13, Chris G wrote:
Yes, I have since discovered that. It works OK too. I'm sure I've used useradd without problems previously though. Oh well, never mind.
Maybe you gave it the right options last time you used it?
My memory (which may be failing of course) was that I just used to do "useradd <username>" and I got the basic set-up of a new user.
I have to say that I used to edit the password file directly (using vipw if I was being good) and that was actually quite straightforward. One had to create the home directory as well of course but it's hardly difficult.
-- Chris Green
I used to do that too, Chris. There's a lot to be said for using bare hands.
Problem nowadays is, though, that you can't get wooden ploughshares any more, let alone the horses. We'd better get used to these big machines with SatNavs inside.
Oi got a traacter Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 22-Dec-08 Time: 13:41:08 ------------------------------ XFMail ------------------------------
On Mon, Dec 22, 2008 at 01:41:12PM -0000, Ted Harding wrote:
On 22-Dec-08 13:26:10, Chris G wrote:
On Mon, Dec 22, 2008 at 11:18:59AM +0000, David Reynolds wrote:
On 22 Dec 2008, at 11:13, Chris G wrote:
Yes, I have since discovered that. It works OK too. I'm sure I've used useradd without problems previously though. Oh well, never mind.
Maybe you gave it the right options last time you used it?
My memory (which may be failing of course) was that I just used to do "useradd <username>" and I got the basic set-up of a new user.
I have to say that I used to edit the password file directly (using vipw if I was being good) and that was actually quite straightforward. One had to create the home directory as well of course but it's hardly difficult.
-- Chris Green
I used to do that too, Chris. There's a lot to be said for using bare hands.
Problem nowadays is, though, that you can't get wooden ploughshares any more, let alone the horses. We'd better get used to these big machines with SatNavs inside.
Oi got a traacter
So have I (got a traacter that is), it's excellent for pulling the ride-on mower out of rabbit holes! :-)
On 21/12/2008 21:01:57, Chris G wrote:
Even if I log in to the newly created user and try and execute the files I get a really odd error message:-
$ . .profile .: 13: .profile: not found $
The file .profile does exist:-
I think the reason this is happening is because . (current directory) is not in your command search path and the . shell command looks for the file to be sourced on that search path.
If you did
. ~/.profile
it should work.
Regards, Steve.