"James Beltran" <a-j...@microsoft.com> wrote:
>Is there a way to add users without using the ADMINTOOL utility?
>A command line interace alternative? I am behind a proxy server
>and cannot open a x session to open the admintool utility.
-
Dan Anderson <spam-reg...@news.fuller.edu>
San Diego, California, USA
dan
- @ -
cts.com
Any help would be great.
James
--
The opinions expressed in this message are my own personal views
and do not reflect the official views of the Microsoft Corporation.
Yes, edit /etc/passwd and /etc/shadow and add the new user, then create
user dir as specified in /etc/passwd.
--Sunil
man useradd
Since when? If you manually edit /etc/shadow correctly, pwconv is not
required.
-am
>
> Is there a way to add users without using the ADMINTOOL utility?
> A command line interace alternative? I am behind a proxy server
> and cannot open a x session to open the admintool utility.
>
> Any help would be great.
Edit the passwd file with you favorite editor.
use mkdir to create the directory
use chgrp chown to give it to the user.
f.g.
P.S. I just hate click-o-rama...
--
Look at the things around you, the immediate world around you. If you are
alive, it will mean something to you, and if you care enough about
photography, and if you know how to use it, you will want to photograph that
meaningness. If you let other people's vision get between the world and your
own, you will achieve that extremely common and worthless thing, a pictorial
photograph.
Paul Strand "The Art Motive in Photography" the British Journal of Photography
1923, p 613
Frederic Goudal - gou...@enserb.u-bordeaux.fr - http://www.insat.com/~filh -
Don
This is difficult to do ???
vi /etc/passwd
vi /etc/shadow
mkdir userdir
chmod 755 userdir
chown username userdir
chgrp usergroup userdir
All that useradd etc., do is hide details that a sysadmin type is supposed to
know anyway. And this is the simple stuff...
--Sunil
: vi /etc/passwd <--- You should be using /usr/ucb/vipw
: vi /etc/shadow
: mkdir userdir <--- You put homedirs in /etc? :)
: chmod 755 userdir
: chown username userdir
: chgrp usergroup userdir
Compared with:
useradd -m -d /home/userdir -c 'Luser' -s -g usergroup /usershell username
Frankly, yes.
: All that useradd etc., do is hide details that a sysadmin type is supposed to
: know anyway. And this is the simple stuff...
They're supposed to know it, but why mess with files like that manually?
I generally do not encourage screwing with passwd and shadow by hand.
ESPECIALLY the way you do it... all you need is someone changing their
password while you're messing around inside the file and you overwrite their
changes, or they overwrite yours...
--
| Brandon Hume aka "Hurricane" - hume at ug.cs.dal.ca & isisnet.com |
| "What was your username again? *Clickity-click*" |
'useradd' is *much* easier, but if you do insist on editing the
/etc/passwd and /etc/shadow files you *must* do a 'pwconv' after you're
done editing
--
/*-------------------------------------------------------------*/
/* Mike D. Kail | voice: (619) 350-3524 */
/* Unix System Architect | fax: (619) 793-2950 */
/* FIRST VIRTUAL Holdings Inc. | e-mail: mdk...@fv.com */
/*-------------------------------------------------------------*/
Try a man on useradd.
DD
>
> On 28 Oct 1997 22:09:34 -0600, Sunil Kandwala <skha...@xnet.com> wrote:
> >>
> >>"James Beltran" <a-j...@microsoft.com> wrote:
> >>>Is there a way to add users without using the ADMINTOOL utility?
> >>>A command line interace alternative? I am behind a proxy server
> >>>and cannot open a x session to open the admintool utility.
> >
> >Yes, edit /etc/passwd and /etc/shadow and add the new user, then create
> >user dir as specified in /etc/passwd.
>
> 'useradd' is *much* easier, but if you do insist on editing the
> /etc/passwd and /etc/shadow files you *must* do a 'pwconv' after you're
> done editing
Never done that and working fine. Just taking care shadow and passwd
file are in the same order. (Ok We use /etc/shadow for very little
account, the main ones are done with nis database from another file).
f.g.
Maybe different tools are better at different times, and there
is a place for both. Steve Ward's example of a script that
read the enrollment lists, and then set up new accounts for
hundreds of new users, could not be done nearly so well without
useradd. The fact that sed or awk might do it does not
match the ease with which useradd would do it and with fewer
processes. If you'll be doing it many times, a nice tool is
handy.
Cheers,
Harrison
--
==================================================================
P. Harrison Picot II 703.925.7013
System Manager fax 703.708.7233
Aerospace and Defense 196 Van Buren St
Oracle Corporation Herndon, VA
=== "I'm confessin', I don't speak for anyone, I never took ===
=== a lesson, this stuff I do is just a matter of guessin'" txca
Agreed, if you have to add many users at once, then yes, absolutely
use a script, useradd etc. However, as you say, knowing both
is definately an advantage. Actually, I use scripts to monitor/sanity
check many things. Setting these things up w/cron and having
them mail you when things go belly up is quite useful.
cheers,
--Sunil
If you have adminsuite loaded, you can do it with
/opt/SUNWadm/bin/admuseradd. Check the manpage for
details.
: James
Ben
That's a real problem. Emacs just tells you the file has been
changed. So you don't overwrite it.
But is adduser secure about that ???
> They're supposed to know it, but why mess with files like that manually?
> I generally do not encourage screwing with passwd and shadow by hand.
> ESPECIALLY the way you do it... all you need is someone changing their
> password while you're messing around inside the file and you overwrite their
> changes, or they overwrite yours...
Your comments are incorrect. vipw creates a lock on /etc/passwd.
Passwords are stored in /etc/shadow now. Changing your password
has no effect on /etc/passwd. So the vipw command is next to
useless now (unless you have more than one sysadmin or someone
uses some of the other features of the password command, such
as changing one's shell). Oh, and Sunil wasn't in /etc. Note
the command 'vi /ETC/...', this suggests he was elsewhere,
like a home tree perhaps. Sunil's example can be further
refined as -
vi /etc/passwd /etc/shadow (might as well vi them both at once)
mkdir userdir
chmod 755 userdir
chown username:usergroup userdir
Only 4 commands. Trivial, I'd say.
[As an aside, when a former employer was looking for an extra
sysadmin, one test question they were asked was how do you
add new users. Everyone knew admintool, a few knew useradd
but only one knew the files that were touched and how to do
it manually. Guess which one was hired?]
-am
They don't have to be in the same order. And entries can be
missing from either with no ill effect (apart from the
obvious). Try it.
-am
Yes, /etc/ptmp. It also creates /etc/stmp, which other utilities don't
appear to check for when altering the shadow file. I'd call that a bug.
: but only one knew the files that were touched and how to do
: it manually. Guess which one was hired?]
I know *I* wouldn't want to hire someone who couldn't fix a damaged
passwd/shadow combo without /usr mounted. But we don't appear to be
distinguishing between the way you CAN do things, and the way you're
SUPPOSED to do things... so I'll concede...
Well, so far we have 3 possible ways of doing it.
As to how you're supposed to do it, it would depend
on personal preferences.
Originally, there was only one way to do it. Some see
no reason to change. I suppose we can start a jihad
over this issue just for the fun of it. Or just revel
in the fact that admin is getting easier. Of course,
novices vi'ing password files raises two points -
do you let them learn or do you just want to prevent
them from possibly doing something incorrectly?
-am
>
> "James Beltran" <a-j...@microsoft.com> writes:
>
> >
> > Is there a way to add users without using the ADMINTOOL utility?
> > A command line interace alternative? I am behind a proxy server
> > and cannot open a x session to open the admintool utility.
> >
> > Any help would be great.
>
> Edit the passwd file with you favorite editor.
Ooh - bad idea. /usr/ucb/vipw will use your favorite $EDITOR for you,
but it does proper file locking and if you screw up the format of a line
noticably enough (like say leaving something without a valid /etc/shells
shell), it won't let you make the changes.
As far as adding users, I've found that a shell script written around
useradd tends to work best with minimal overhead.
-fil
___________________________________________________________________________
Fil Krohnengold | UNIX Systems Admin, Interdepartmental Laboratories
f...@amnh.org | The American Museum of Natural History
212/769-5294 | CPW @ 79thSt / NY, New York / 10024
Also, the 'useradd, usermod, userdel' family from SVR4 are pretty
good and easy, IMO. Just type the command, hit return, and it will
print out the app and appropriate keywords. You can easily use it
in shell scripts(I have)
virgo 'U.S.' bondz
--
Paul Virgo And now..a square dance call...
RMS Slapyerpardnerindaface
Goddard Space Flight Center Writebadchecksalloverdaplace
'It's not rocket science.... Flirtwithstrangersannoyyerspouse
it's ROCKETMAAAAAAAN!!!' Getadivorceandloseyerhouse,dosey-do...
--Dogbert
For example:
useradd -d /usr/home/alfa -s /usr/bin/csh alfa
should add the 'alfa' directory to the /usr/home directory, but it
doesn't and I have to go and add the directory by hand as well as a copy
of the dot files.
By comparison the 'adduser' script on OSF/1 runs real well
Arvind
Paul Virgo.RMS.S411.x???? (pvi...@vlsi.gsfc.nasa.gov) wrote:
--
------------------------------------------------------------------------------
The MiNd is like a PaRaChUtE.. it works when its OpEn
==============================================================================
af...@city.ac.uk http://www.city.ac.uk/~af281
==============================================================================
It's not for "whatever" reason - it's because you haven't told it to!
Check the manpage for useradd, which tells you "and creates the home
directory (-m option) for the user if requested. "
This
# useradd -d /usr/home/alfa -m -s /usr/bin/csh alfa
does the trick.
Tony
Speaking for myself, not for Sun
The -m option is used to create the directory. Check
the man pages.
--
Dennis Piche
Server and Network Services
FSIC - Ford Motor Company
(313) 621-7578 dpi...@ford.com SEIZE THE DAY!!
(I am speaking for myself - not Ford Motor Company)
Anthony Mandic <no_s...@agd.nsw.gov.au> writes:
>
> vi /etc/passwd /etc/shadow (might as well vi them both at once)
> mkdir userdir
> chmod 755 userdir
> chown username:usergroup userdir
>
> Only 4 commands. Trivial, I'd say.
Not quite....
vi /etc/passwd /etc/shadow (might as well vi them both at once)
Gousername:x:666:666:Luser:/home/userdir:/usershell<ESC>:wn
Gousername:::::::<ESC>ZZ
mkdir userdir
chmod 755 userdir
chown username:usergroup userdir
I think I'd take
useradd -m -d /home/userdir -c 'Luser' -s -g usergroup /usershell username
any day it was available....
A.
--
Andrew Fitzgibbon, a...@robots.ox.ac.uk
Oxford Information Engineering Research Group +44 01865 273127
<a href=http://www.robots.ox.ac.uk/~awf> Home Page </a>
"Never say there is no way"
> Not quite....
>
> vi /etc/passwd /etc/shadow (might as well vi them both at once)
> Gousername:x:666:666:Luser:/home/userdir:/usershell<ESC>:wn
Hmmmm... you may also need to edit the groups file to
add the beast group.
> Gousername:::::::<ESC>ZZ
> mkdir userdir
> chmod 755 userdir
> chown username:usergroup userdir
>
> I think I'd take
>
> useradd -m -d /home/userdir -c 'Luser' -s -g usergroup /usershell username
>
> any day it was available....
>
> A.
-am
There is another easy way to work around :
1) vi "/etc/auto_master"
2) comment out the line with directory /home
3) save it
4) run "admintool" in X windows
5) addusers and modify ....etc.
6) piece of cake