Bash cannot act as nobody and nogroup?

13,093

Solution 1

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.

Solution 2

An email thread:

.. 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
Share:
13,093

Related videos on Youtube

ThorSummoner
Author by

ThorSummoner

Updated on September 18, 2022

Comments

  • ThorSummoner
    ThorSummoner almost 2 years

    I have a log file that was created by nobody:nogroup, which is activity being logged to, I wanted to emulate adding a message to that log file. My first thought was to:

    $ sudo su nobody
    This account is currently not available.