2

I used the following command to create my user:

useradd -m multicraft

And it doesn't show up in this list:

users

All that shows up in that list is this:

root@ns530757://home/multicraft# users 
root root
root@ns530757://home/multicraft# 

and so when I try to run multicraft daemon it says it can't find the user multicraft. The home directory was created (that's the -m option). Can you please tell me what i'm doing incorrectly that could lead to the user not being added to the list?

2 Answers 2

7

Whatever you want to do the command users is not what you need.

USERS(1)                         User Commands                        USERS(1)

NAME
       users  -  print the user names of users currently logged in to the cur‐
       rent host

It will list users currently logged in and not the users available in that system. root root means you are logged in with root twice.

Place to check on users:

  • ls /home/ will list all the names of users created with useradd -m or adduser
  • more /etc/passwd | grep multicraft will list the lines that have multicraft in them.

I have a strong feeling you are doing this wrong. I would assume it uses a database backend and you need a user on that backend to be able to connect to it. Probably that needs to be done as part of the installation when you reach the database setup part of the installation or when you 1st log into the multicraft control panel and not as a local user on your system?

Can you please edit into the question the installation instructions of the download of this multicraft server you used?


From the links added to the question I seem to be correct:

Using SQLite If you're using an SQLite database (the default) the user running the control panel needs to have access to it. On a default Debian setup this user will usually be "www-data". In order to create files with the correct permissions the daemon has to be run as root (it will drop the privileges as soon as the files have been created and the permissions set). Alternatively the daemon can be run under the user of the control panel. This implies that everything created by the daemon will be owned by the user running the control panel (e.g. "www-data").

Using MySQL When using MySQL the user of the control panel doesn't need to access any files of the daemon directly and can even be installed on a different machine. The database is configured in "multicraft.conf" and there are example lines for MySQL.

Please see How To's for more advanced configurations.

The How To links to this

Grant Access to Daemon MySQL Users The following queries are run directly in MySQL. You can use any tool to access MySQL, from the command line it would be:

mysql -uroot -p 

Replace "root" with the name of a privileged MySQL user.

It's recommended to create a new MySQL user for each daemon. For example if your daemon is running on 2.3.4.5:

GRANT ALL ON multicraft_daemon.* TO daemon1@'2.3.4.5' IDENTIFIED BY 'mysql_password_for_daemon1'; 

In the "multicraft.conf" of daemon 1 you would then put:

database = mysql:host=1.2.3.4;dbname=multicraft_daemon
dbUser = daemon1
dbPassword = mysql_password_for_daemon1

It's also possible to use the same user for all daemons. In that case you'd replace "TO daemon1@'2.3.4.5'" with "TO daemon@'%'" in the above example.

You can further restrict the database access of daemon users based on the following security recommendation: Separate Daemon and Panel Databases

5
  • 3
    ... or getent passwd multicraft Aug 15, 2018 at 16:55
  • 2
    ... or grep multicraft /etc/passwd
    – waltinator
    Aug 15, 2018 at 17:42
  • there is a daemon server that is utilized by the multicraft system and it utalizes a user on the computer to store server data underneath. For instance, i want it to use the user multicraft on my computer so it stores its data in that user's home folder. I also added the links to the multicraft info.
    – Kwright02
    Aug 15, 2018 at 18:01
  • @Kwright02 here you go :) You indeed need to follow the installation part for the database you use (I assumed mysql. There is also a bit about configuring the deamon config (it needs to match your mysql settings)).
    – Rinzwind
    Aug 15, 2018 at 19:12
  • the database works fine, it's that it's not detecting the fact i made a new user on the computer even though I set it in the config
    – Kwright02
    Aug 16, 2018 at 2:29
2

You will find the new user in the /etc/passwd file:

grep multicraft /etc/passwd

While the command users prints the user names of users currently logged in to the current host.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.