I want to create a user in such a way that it can create a file and update the contents of the file.

useradd username 

Now for sudo, we can create username and linking to sudo like below:

useradd username sudo

But I dont want to give sudo access. Without sudo access, I am unable to create files and update files.

  • If you don't want to give sudo privilege, then don't give sudo privilege (don't add user to group, sudo). All users can create, write, read files. Jul 19, 2016 at 8:08

1 Answer 1


Depending on what files you want, you can create a new group (/etc/group) and make the file writable (and the directory containing it if you want the user to create new files) by that group (e.g., chgrp <groupname> <file>; chmod g+w <file>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .