Score:0

What am I getting this error/Why is the connection "timed out"?

mo flag

I ran the commands listed below to help solve the "Connection timed issue but they did nothing:

sudo systemctl status ssh
sudo apt update
audo apt install open-ssh server

When I run ssh user@ipaddress I get ssh: connect to host ipaddress port 22: Connection timed out

Here is the error I receive when I run the file in terminal:

./file.sh
Working...
Sending to users's device
ssh: connect to host ipaddress port 22: Connection timed out
abcd
[sudo] password for me:
sudo: a password is required
[sudo] password for me:
Failed to start apache2.service: Unit apache2.service is masked.
Unit rabbitmq-server.service could not be found.
Failed to start rabbitmq-server.service: Unit rabbitmq-server.service not found.
Unit mysql.service could not be found.
Failed to start mysql.service: Unit 

mysql.service not found.

Here's the file:

#!/bin/bash
echo "Working..."
echo "Sending to users device"
ssh -t -p 22 users@ipadress
echo "abcd"
sudo systemctl status apache2
sudo systemctl start apache2
sudo systemctl status rabbitmq-server
sudo systemctl start rabbitmq-server
sudo systemctl status mysql
sudo systemctl start mysql

I'm not sure what to do next. I have tried so many things and they are not working. Is it my code? Any help would be appreciated.

Nmath avatar
ng flag
Ignore the script. Can you actually connect to the server over ssh?
Gemma B avatar
mo flag
I cannot to the server
Nmath avatar
ng flag
Most of the details you added here are not at all relevant to that specific problem. Make this easier on yourself and focus on one problem at a time. If you want your script to connect to some ssh server you need to have access to that server and the ability to connect over ssh. If the command gives an error in your terminal then it will also give you an error in your script. So ignore the script for now and figure out what command you need to access the ssh server. Who administers that server? If it's your server, you need to configure it to accept incoming ssh connection.
Nmath avatar
ng flag
I suggest you go back to the beginning with your research. You need to determine how to connect to this particular ssh server if you need that as part of your script. A script will not work if its parts do not work individually.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.