Question: In my project, I have to install some package remotely. If I have to login in debian, I say: 

```
$ ssh root@remotehostname
root@remotehostname's password: 

```

it logs in successfully. 

I have login in **ubuntu** in directly using

```
 $ root@remotehostname
 root@remotehostname's password:

```

it is throw error message in

```
Permission denied, please try again.

```

How to solve this problem?

Answer: 
You could set a password for root, but this is not recommended and could open a security risk. But if you have an user account on the target system that has sudo credentials, you could log in as user:

```
ssh user@remotehostname
user@remotehostname's password:

```

and then do what you want using sudo or get a root shell the recommended way:

```
user@remotehostname$ sudo su
Password:
root@remotehostname#

```

and then do your housekeeping. Instead of 'sudo su' you also could use 'sudo -i', which is equivalent, or 'sudo -s', that keeps the current environment.

See [Ubuntu Sudo/Root documentation](https://help.ubuntu.com/community/RootSudo)
1. Edit sshd\_config file `vi /etc/ssh/sshd_config`
2. Comment out `#PermitRootLogin without-password` under Authentication:
3. insert below `PermitRootLogin yes`
4. Save the file.
5. Restart the ssh service `service ssh restart`