0

I have given the following command in the terminal:

ssh -L 8080:localhost:8888 bb@example

However, the following error appears:

ssh: connect to host example port 22: Connection refused

I have also tried:

sudo apt list --installed | grep openssh-server

But the following error appears:

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

When I type

sudo service ssh status

, This is the error I get:

sudo: service: command not found
5
  • 1
    1) Which one of the computers involved is macOS? What OS is the other one running? 2) Are you trying the 2nd and 3rd commands on your own computer, or physically on the example server? 3) What was the full output of the command that produced the Java error? Commented Aug 21, 2021 at 10:18
  • I'm trying to get connected to another server using macOS. All these commands are on my own computer. I have already written the full command.
    – B Noor
    Commented Aug 21, 2021 at 11:16
  • The OS of the other server is Ubuntu 18.
    – B Noor
    Commented Aug 21, 2021 at 11:17
  • localhost is shorthand for 'me'. It won't connect to any other machine/VM except itself. After that, it's really not clear what you are trying to achieve.
    – Tetsujin
    Commented Aug 21, 2021 at 14:24
  • Is the server actually named "example"? If you run ping example, does that reach the server? Also, as I commented on stackoverflow, apt and service are not relevant on macOS (and since the macOS computer isn't the server, trying to install/start ssh service on it isn't relevant anyway). Commented Aug 21, 2021 at 19:40

0

You must log in to answer this question.

Browse other questions tagged .