# ssh doesn't work



## rajasekhar (Jan 22, 2010)

Hi All,

I have just installed FreeBSD.
I have a linux machine too.
From linux machine I am not able to do ssh.

The following error is displayed :


```
[root@localhost ~]# ssh 10.130.98.107
Permission denied (publickey).
[root@localhost ~]#
```
Thanks,
RajaSekhar


----------



## SirDice (Jan 22, 2010)

You cannot login in as root directly with ssh. Create a user account and use su/sudo.


----------



## rajasekhar (Jan 22, 2010)

*ssh login*

I tried with this also. It fails again.


```
[root@localhost ~]# ssh root@10.130.98.107
Permission denied (publickey).
[root@localhost ~]#
```

Thanks,


----------



## aragon (Jan 22, 2010)

It is telling you that your public key does not have access.  Have you added your public key to that account's authorized_keys file?  And are root logins enabled?


----------



## SirDice (Jan 22, 2010)

rajasekhar said:
			
		

> I tried with this also. It fails again.
> 
> ```
> [root@localhost ~]# ssh root@10.130.98.107
> ...


Let me rephrase that. By default you can NOT login with root directly. Login with a 'regular' user account and use su or sudo to become root.


----------



## mix_room (Jan 22, 2010)

SirDice said:
			
		

> Let me rephrase that.



Since this seems to be slightly difficult to grasp, what SirDice means is the following


```
[rajasekhar@[color="Red"]localhost [/color]~]# ssh rajasekhar@remotehost

...

[rajasekhar@[color="Red"]remotehost [/color]~]# su root
```


----------



## Speedy (Jan 22, 2010)

... and the whole idea behind this is root account is not an user account, it's the housekeeper account. You do not use your computer as root, you do not make remote connections as root, you do not chat on IRC as root, etc.


----------



## anomie (Jan 22, 2010)

rajasekhar said:
			
		

> ```
> [root@localhost ~]# ssh root@10.130.98.107
> Permission denied (publickey).
> ```



In addition to the comments about root logins over ssh, you also have another problem: it seems you've disabled all authentication methods except for Pubkey Authentication. 

You are probably going to want to enable ChallengeResponse Authentication. (Unless you've already properly set up pubkey credentials for your user.)


----------



## Graaf_van_Vlaanderen (Jan 24, 2010)

Also check that root and user account belong to the same group.


----------

