Bash cannot act as nobody and nogroup?

You have a way simpler solution, just run: su -s /bin/bash nobody (replace /bin/bash with the shell of your choice).

The This account is currently not available. error is due to the fact that nobody user default shell is /usr/sbin/nologin, su -s force the system to use another shell.


An email thread:

  • http://www.sudo.ws/pipermail/sudo-users/2002-September/001225.html
  • http://www.sudo.ws/pipermail/sudo-users/2002-September/001226.html

.. points out that sudo -u nobody [cmd ...] can be used:

(Combined with the trick of How to append to a file as sudo)

echo "Hello World" | sudo -u nobody tee -a /tmp/logfile.log