# SSH remote connection, help!



## teo (Apr 15, 2020)

Someone help me how to proceed with the remote SSH connection between Linux as the main system and FreeBSD as the guest system.


----------



## SirDice (Apr 15, 2020)

teo said:


> Someone help me how to proceed with the remote SSH connection between Linux as the main system and FreeBSD as the guest system.


Why is this difficult for you? It's no different from FreeBSD to FreeBSD. Or Linux to Linux. Just use ssh(1).


----------



## teo (Apr 15, 2020)

SirDice said:


> Why is this difficult for you? It's no different from FreeBSD to FreeBSD. Or Linux to Linux. Just use ssh(1).


Because once I tried, I couldn't.


----------



## SirDice (Apr 15, 2020)

Do I need to guess why it's not working? Or are you going to tell us exactly what you did, how the machines are connected and what error messages you got?


----------



## teo (Apr 15, 2020)

SirDice said:


> Do I need to guess why it's not working? Or are you going to tell us exactly what you did, how the machines are connected and what error messages you got?


I did activate SSH on the FreeBSD system, and when I launched the command (I don't remember exactly) from the Linux user terminal, it didn't work.


----------



## SirDice (Apr 15, 2020)

"It didn't work" doesn't tell me anything. _What_ didn't work? Not able to login? Not able to connect? Time-outs? What _exactly_ didn't work? And what was the _exact_ error.


----------



## shkhln (Apr 15, 2020)

This is so dumb, it's not even worth mocking.


SirDice said:


> how the machines are connected



Probably a VM in VirtualBox with default NAT config.


----------



## teo (Apr 15, 2020)

shkhln said:


> This is so dumb, it's not even worth mocking.
> 
> 
> Probably a VM in VirtualBox with default NAT config.


In Virtualbox configuration it is a bridge adapter, in FreeBSD network configuration it is DHCP because it is dynamic, I don't like static network configuration.



SirDice said:


> "It didn't work" doesn't tell me anything. _What_ didn't work? Not able to login? Not able to connect? Time-outs? What _exactly_ didn't work? And what was the _exact_ error.


As I said before, entering the command (I don't remember exactly) from the Linux user terminal, didn't give any result.


----------



## SirDice (Apr 15, 2020)

teo said:


> didn't give any result.


Sigh, it's like pulling teeth. What do you mean by "didn't give any result"?


----------



## teo (Apr 15, 2020)

SirDice said:


> Sigh, it's like pulling teeth. What do you mean by "didn't give any result"?



Looking at something on the internet, the guest FreeBSD user's password is inserted into the Linux user's terminal by entering this command?

$ `ssh oko@localhost`

```
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:B1ofevWPeHW02dSqGlPL/pB1OzYvNALtRVYT2o+dTts.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
oko@localhost's password:
Connection closed by 127.0.0.1 port 22
$
```


----------



## richardtoohey2 (Apr 16, 2020)

That will try to connect to the SSH daemon on whatever "machine" you are running it on.  I don't think localhost is the right thing to use - you need the IP of the SSH daemon's host.


----------



## teo (Apr 16, 2020)

richardtoohey2 said:


> That will try to connect to the SSH daemon on whatever "machine" you are running it on.  I don't think localhost is the right thing to use - you need the IP of the SSH daemon's host.


I try to connect from FreeBSD to linux and it doesn't connect, I put the server key (linux) and it doesn't enter, something is not right ?  

$ `ssh oko@19x.1xx.1.xx`

```
The authenticity of host '19x.1xx.1.xx (19x.1xx.1.xx)' can't be established.
ECDSA key fingerprint is SHA256:g8q5ffvE+5KpqdlYllodGkTt9b0wEuXUoiJXitE/8m0.
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '19x.1xx.1.xx' (ECDSA) to the list of known hosts.
Password for oko@bsd.domain:
Password for oko@bsd.domain:
Password for oko@bsd.domain:
oko@19x.1xx.1.xx: Permission denied (publickey,keyboard-interactive).
$
```


----------



## Zvoni (Apr 16, 2020)

Errrr.......and your public key is stored on your FreeBSD-VM in the correct Directory, with correct read-permissions?
....oO(nevermind that we haven't seen a single line of his sshd_config.....)


----------



## SirDice (Apr 16, 2020)

teo said:


> I try to connect from FreeBSD to linux and it doesn't connect, I put the server key (linux) and it doesn't enter, something is not right ?
> 
> $  ssh oko@19x.1xx.1.xx


Why are you trying to connect as oko?


----------



## Emrion (Apr 16, 2020)

You lack all the bases. Seems your user or password is wrong and you connect to a bsd box not a linux one. So go to your linux box, type `ip address`, get the said address which begins by 192.168 and try this one for ssh from your bsd box.


----------



## teo (Apr 16, 2020)

SirDice said:


> Why are you trying to connect as oko?


Because that's the name of the linux user. 



			
				Emrion said:
			
		

> You lack all the bases. Seems your user or password is wrong and you connect to a bsd box not a linux one. So go to your linux box, type ip address, get the said address which begins by 192.168 and try this one for ssh from your bsd box.


I try the SSH remote connection from the FreeBSD terminal by entering the (user...ip address...password, of Linux) and it won't let me in.


----------



## SKull (Apr 16, 2020)

teo said:


> ... and it won't let me in.


Which is probably for the best...


----------

