日记男孩的博客

甲骨文的主机使用ssh账号密码登陆的方法

方法很简单:

我们知道甲骨文的VPS用SSH登录的时候,都是密钥登录。如果不喜欢把密钥带身上,喜欢用密码登录的话,可以使用这个方法。

先用密钥登录SSH工具,我这里用的是xshell。

首先输入 sudo -i

切换为管理员

接着输入以下代码 :

echo root:YourPasswordHere |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo service sshd restart

将以上代码中的  root:YourPasswordHere  , root后面改成你想要的密码即可。

如图:

 

我在我的甲骨文的centos系统中测试成功。 用密码的方式登录上了SSH。

 

转载请注明:日记男孩的博客 » 甲骨文的主机使用ssh账号密码登陆的方法

赞赏

微信赞赏支付宝赞赏

退出移动版