尝试创建重复的 root 用户,无法再连接到服务器

ham*_*obi 3 linux root ssh

我是 Linux 新手,所以在提供建议时请记住这一点。

我变得过于热情并在这里运行命令:

http://www.shellhacks.com/en/HowTo-Create-USER-with-ROOT-Privileges-in-Linux

useradd -ou 0 -g 0 john
passwd john
Run Code Online (Sandbox Code Playgroud)

现在我尝试按照我通常的方式进行连接:

ssh -i yok.pem root@staging.yok.com -vv
Run Code Online (Sandbox Code Playgroud)

我得到:

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to staging.yok.com [23.23.77.124] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file yok.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file yok.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
Run Code Online (Sandbox Code Playgroud)

幸运的是,我仍然打开了一个与服务器的连接。我检查了我的 ~/.ssh 文件夹,这些文件都有 600 个权限。

我需要在这里做什么?我被困住了。

小智 5

哇好吧,你有没有考虑过删除用户?

userdel john
Run Code Online (Sandbox Code Playgroud)

正如其他人提到的那样,不建议以 root 身份通过 ssh 登录,因此重复 uid 为 0。