Web Hosting Talk







View Full Version : Setting default shell when creating users?


webfors
11-02-2000, 08:00 PM
How do I change the default shell for the adduser command. I want the default shell to be /dev/noshell and not /bin/bash when I add a new user.

Any ideas?

Oh yeah, RedHat 6.1

cbaker17
11-02-2000, 10:41 PM
Im not sure as im not a admin but i was thinking you could edit the passwd file and change the shell there.

Félix C.Courtemanche
11-02-2000, 10:43 PM
use the command userdd to do that
userdd --help for some help, but what you want to do is:

useradd -g GROUP -d /home/dir -s /dev/noshell -p

then give the password, etc.

webfors
11-02-2000, 11:01 PM
Yeah, I know about the editing the /etc/passwd file and how to use the useradd command. I was just wondering if there was a way to change the default shell that useradd defaults to.

Like when I type useradd username it automatically sets the users shell to bash. Is there a way to change it so the when I just type useradd username that the shell defaults to /dev/shell?

Thanks :)


[Edited by tabernack on 11-02-2000 at 10:06 PM]

alchiba
11-02-2000, 11:26 PM
Edit the default settings file /etc/default/useradd.

Travis
11-02-2000, 11:26 PM
useradd is probably a shell script - you ought to be able to take a peek and see where it's selecting bash as a default. (And then change it, of course.)

I'd give you specifics, but I don't work much with RedHat boxes.

JTY
11-03-2000, 12:49 AM
alchiba is correct on editing /etc/default/useradd

webfors
11-03-2000, 01:19 AM
Great,

thanks Alchiba, that's exactly what I was looking for.