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: 
[Ubuntu documentation](https://help.ubuntu.com/community/RootSudo) says:

> 
> **By default, the Root account password is locked in Ubuntu.**
> 
> 
> 

It also says:

> 
> **Please keep in mind, a substantial number of Ubuntu users are new to
>  Linux.** There is a learning curve associated with any OS and many new
>  users try to take shortcuts by enabling the root account, logging in
>  as root, and changing ownership of system files.
> 
> 
> 

It talks at length about why it's been done this way.

---

Enabling the root account:

```
sudo -i

```

To enable the Root account (i.e. set a password) use: 

```
sudo passwd root

```

**Use at your own risk!**

> 
> **Logging in to X as root may cause very serious trouble.** If you believe
>  you need a root account to perform a certain action, **please consult
>  the official support channels first**, to make sure there is not a
>  better alternative.
> 
> 
>
edit your /etc/sshd\_config doing:

```
sudo /etc/sshd_config

```

search for line having **PermitRootLogin** into *Authentication* Section and uncomment **PermitRootLogin** or set **PermitRootLogin yes**. Or simply add this line to the end of file:

```
PermitRootLogin yes

```

Next you'll gonna restart ssh daemon doing

```
/etc/init.d/ssh restart 

```

or

```
service ssh restart

```

depending on your linux distribution
Now you'll login via ssh with your root account
Warning: For security reason this is not recommended. What you can do is login with any other accound via ssh and within your user session do:

```
sudo command

```

or simply: 

```
sudo su

```

to continue session under your root account