D
D
Dimon3x2019-06-26 09:27:13
linux
Dimon3x, 2019-06-26 09:27:13

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

Then I check and he has such a directory
test:x:0:0::/home/test:/bin/sh
, and root
has this
root:x:0:0:root:/root:/bin/bash
How to make a user so that he also has everything, like root?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladimir, 2019-06-26
@Casufi

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.

T
TyzhSysAdmin, 2019-06-26
@POS_troi

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.

C
CityCat4, 2019-06-26
@CityCat4

How to make a user so that he also has everything, like root?

n't have to throw anything into the root homework - root is the user for performing server system administration tasks when editing configs is required. A noob needs to get it over with. By heart.
For daily work, you need to create a regular user, which (here via root) should be given the necessary rights and work only from this user

K
Karpion, 2019-06-26
@Karpion

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 ...

P
Puma Thailand, 2019-06-27
@opium

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 question

Ask a Question

731 491 924 answers to any question