马春杰杰 Exit Reader Mode

Please login as the user “opc” rather than the user “root”.

甲骨文的服务器root登录,提示:Please login as the user "opc" rather than the user "root".

即使已经在sshd_config中允许了root登录,仍然报这个错。其实,主要是Oracle Cloud Infrastructure(OCI)的实例默认要求就是这么干的,不过我们也有办法,打开下面这个文件:

vi /root/.ssh/authorized_keys

会发现里面默认有两行:

no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"opc\" rather than the user \"root\".';echo;sleep 10" ssh-rsa AAAAB3NzaC1yc2EAAAADADcN4gX77baQcyZ+tScj ssh-4-10
ssh-ed25519 AAAAC3NzaCUi1bYEIx root@insta10-1646

删掉第一行中ssh-rsa前面的内容就可以了,只保留下面这些:

ssh-rsa AAAAB3NzaC1yc2EAAAADADcN4gX77baQcyZ+tScj ssh-4-10
ssh-ed25519 AAAAC3NzaCUi1bYEIx root@insta10-1646