Answer the question
In order to leave comments, you need to log in
How to create a user with root rights and in the same directory?
I took a VPS, now, in order to connect via FTP, you need to create a new user, because you cannot log in as root.
I do it like this
sudo useradd -ou 0 -g 0 test
sudo passwd 634gdf264h4
test:x:0:0::/home/test:/bin/sh
root:x:0:0:root:/root:/bin/bash
Answer the question
In order to leave comments, you need to log in
There is no need to create a user with root rights, which is why root access via SSH is closed by default. Change the process so you don't have to pour files into the root folder.
1. never do that .
Your password will remain in plain text in bash history
2. Forget about root here at all, and never touch it with your hands
3. Never run anything from root - from services and especially WEB.
I beg you, order the settings from the TP hoster or on a freelance somewhere, do not produce botnet nodes.
How to make a user so that he also has everything, like root?
The "useradd" command allows you to specify the user's home directory.
In general, it makes sense to study the structure of the files that store this information: "/etc/passwd" and "/etc/shadow" - they can be edited in any text editor.
You correctly decided that root rights are given through UID==GID==0.
However, Above you were very correctly pointed out that it is forbidden to use root to connect via most protocols - they simply will not let you in under a user with UID == 0. For the command line (shell) use "sudo"; and via FTP root is not available at all. In principle, this can be changed - but it would be a huge security hole.
As for your question, it's not at all clear why you need FTP access to ~root ...
So you forgot to specify the directory to the user, but why the heck is the second user with the same rights, use root right away
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question