Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone help me to add one line to any file from this:

/etc/passwd , /etc/shadow ,/etc/group

exp; username:!!: …. add to /etc/shadow by shell script without vi program

share|improve this question

Unless extraordinary circumstances make this unsuitable, it is preferable to make your script use utilities like passwd, usermod, groupmod, useradd, groupadd, adduser, and addgroup. (Check out the manual pages for those utilities, which are available on your Ubuntu system via the man commands and in yelp, and also on the web at

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.