By default, the SSH server denies password-based login for root. In
to
And restart SSH:
Or, you can use SSH keys. If you don't have one, create one using
/etc/ssh/sshd_config
, change:
PermitRootLogin without-password
to
PermitRootLogin yes
And restart SSH:
sudo service ssh restart
Or, you can use SSH keys. If you don't have one, create one using
ssh-keygen
(stick to the default for the key, and skip the password if you feel like it). Then do sudo -s
(or whatever your preferred method of becoming root is), and add an SSH key to /root/.ssh/authorized_keys
:
cat /home/user/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
in some case after change,PermitRootLogin yesmust check this config :DenyUsers root AllowUsers saeidand to enable login must change to :#DenyUsers root AllowUsers root OtherUser
0 comments:
Post a Comment