01-24-07 06:47 AM
In article SrOdnZD-2Pf7tivYnZ2dnUVZ_r3inZ2d@umontreal.ca, dated Tue, 23
Jan 2007 10:36:06 -0500, Faouzi Gassemi <faouzi@DMS.UMontreal.CA> wrote:
> hji how could i remove a user from the /etc/passwd file in a bash script
?
>
>
> user1:/home/user1:/bin/bash
> user2:/home/user2:/bin/bash
> user3:/home/user3:/bin/bash
>
> i would like to have a assurance that it is user1 like (y/n)
> and remove him from the file.
>
> Thanks
Simply removing the user's entry from /etc/passwd alone is not a good
idea. Most systems provide tools for managing the user/password database,
and if you circumvent these by trying a shortcut method, you're asking for
trouble, i.e., you'll wind up with corruption in the database.
It's impossible to advise you any further without knowing the specific OS
you're running, as the tools vary from system to system.
--
Conrad J. Sabatier <conrads@cox.net>
"In Unix veritas"
[ Post a follow-up to this message ]
|