Creating a read-only Linux User

Preface

Creating a read-only Linux local user for something like auditing purpose.

Preresquite

  • Root/sudo access to the server.

Procedure

Create the User

sudo useradd <username>

Create the Password for the User

sudo passwd <username>

It will interactively ask for a password input, so input it.

Set Access List for the User

setfacl -Rd -m u:<username>:rx /path-to-the-folder # for future files
setfacl -R -m u:<username>:rx /path-to-the-folder # for curent exisiting files

Conclusion

That’s it.

References