newbie help !
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > newbie help !




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    newbie help !  
Faouzi Gassemi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-07 06:23 PM

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





[ Post a follow-up to this message ]



    Re: newbie help !  
Conrad J. Sabatier


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:28 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register