我的 /etc/passwd 文件中的 debian-tor 是谁?

fnd*_*357 6 users passwd-file 18.04

我在以下位置找到了这个条目/etc/passwd

debian-tor:x:117:123::/var/lib/tor:/bin/false
Run Code Online (Sandbox Code Playgroud)

但是没有/var/lib/tor文件夹。这是在服务器上而不是桌面上。

Pil*_*ot6 6

这是通过安装tor或创建的用户tor-browser

例如,如果您查看包的postinst脚本tor,您会看到:

# checking debian-tor account

uid=`getent passwd debian-tor | cut -d ":" -f 3`
home=`getent passwd debian-tor | cut -d ":" -f 6`

# if there is the uid the account is there and we can do
# the sanit(ar)y checks otherwise we can safely create it.

if [ "$uid" ]; then
    if [ "$home" = "/var/lib/tor" ]; then
        :
        #echo "debian-tor homedir check: ok"
    else
        echo "ERROR: debian-tor account has an unexpected home directory!"
        echo "It should be '/var/lib/tor', but it is '$home'."
        echo "Removing the debian-tor user might fix this, but the question"
        echo "remains how you got into this mess to begin with."
        exit 1
    fi
else
    adduser --quiet \
        --system \
        --disabled-password \
        --home /var/lib/tor \
        --no-create-home \
        --shell /bin/false \
        --group \
        debian-tor
fi


for i in lib log; do
    if ! [ -d "/var/$i/tor" ]; then
        echo "Something or somebody made /var/$i/tor disappear."
        echo "Creating one for you again."
        mkdir "/var/$i/tor"
    fi
done

which restorecon >/dev/null 2>&1 && restorecon /var/lib/tor
chown debian-tor:debian-tor /var/lib/tor
chmod 02700 /var/lib/tor

which restorecon >/dev/null 2>&1 && restorecon /var/log/tor
chown debian-tor:adm /var/log/tor
chmod 02750 /var/log/tor
Run Code Online (Sandbox Code Playgroud)

但卸载时不会删除此用户tor。我没有看到任何删除prerm, 或postrm脚本中的用户的内容。

所以这意味着你已经tor安装,或者之前安装过它。

在您的系统中添加一些额外的用户并没有什么坏处,但是如果您愿意,可以将其删除。

您可以通过运行删除用户

sudo deluser debian-tor
Run Code Online (Sandbox Code Playgroud)

  • 当您从中删除唯一的用户时,该组很可能已被自动删除。 (2认同)