SSH Connection timed out [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have two PC in my network. I want that PC1 have got ssh access to PC2.
On PC2 I have installed ssh-server. In PC2 inet addr:192.168.0.100 . Next I execute on PC1 this command: ssh root#192.168.0.100 and get error: Connection timeout. I'm use Ubuntu 15.04
Why? What I need configure for my task?
UPD:
sudo netstat -tulpen | grep ":22"
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 75804 8281/sshd
tcp6 0 0 :::22 :::* LISTEN 0 75806 8281/sshd
udp6 0 0 :::22918 :::* 0 65985 6596/dhclient
UPD2:
root#v400:/ # ssh -vv ivan#192.168.0.100
OpenSSH_6.4, OpenSSL 1.0.1j 15 Oct 2014
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.100 [192.168.0.100] port 22.
debug1: connect to address 192.168.0.100 port 22: Connection timed out
ssh: connect to host 192.168.0.100 port 22: Connection timed out
root#v400:/ # nc 192.168.0.100 22
Failed to connect nc 192.168.0.100:22

As came out in comments, disable ufw. Uncomplicated Firewall (ufw) will by default block ssh connections as well.

Related

ssh: connect to host ******* port 22: Connection timed out [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
i have dibian server running and every time i make ssh connection this error comes
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug3: Failed to open file:C:/Users/User/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.3.30 is address
debug2: ssh_connect_direct
debug1: Connecting to ***** [*****] port 22.
debug3: finish_connect - ERROR: async io completed with error: 10060, io:000001C796F03E30
debug1: connect to address 192.168.3.30 port 22: Connection timed out
ssh: connect to host 192.168.3.30 port 22: Connection timed out
i checked the ssh if it is installed or not on dibian and it was running
i checked if the port is closed but it was opened

Difference in various local ports [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
When I run $ netstat -ntlp I get the following output:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
To make sense of the output I have a few questions:
What is the difference in the "Foreign Address" between 0.0.0.0:* and :::*?
Why do some ports, such as 22 have an entry in both tcp and tcp6?
For the local address, what is the difference between ::: and 127.0.0.1 and 0.0.0.0 (and localhost)?
What is the difference in the "Foreign Address" between 0.0.0.0:* and :::*?
In the first case it is is IPv4, in the second one IPv6.
Why do some ports, such as 22 have an entry in both tcp and tcp6?
Because the server is listening with two different sockets on IPv4 and IPv6. Some servers try to use a single socket for both (not supported on all OS), some use different sockets. In case of OpenSSH: it supports listening on multiple IP:port anyway and it also originates from OpenBSD where listening for IPv4 and IPv6 with a single socket is not supported (explicit decision, for security).
For the local address, what is the difference between ::: and 127.0.0.1 and 0.0.0.0 (and localhost)? Are these all the same, or why are they referenced differently?
::: is the ANY address for IPv6 while 0.0.0.0 is the any address for IPv4 - with these listener address the server will accept traffic on all IP addresses it has (i.e. all interfaces: local, ethernet, wifi, VPN...). 127.0.0.1 is localhost for IPv4, i.e. only connections from the local machine are possible. The IPv6 localhost would be ::1. What localhost means depends on the entries in /etc/hosts, typically the same as 127.0.0.1.

Azue Linux machine not connecting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
While working on a Microsoft Azure virtual machine I noticed it was lagging significantly, so I decided to run the sudo reboot command then ssh back in. When I tried to ssh back in with
ssh user#ipaddress
i got the error:
ssh: connect to host xxx.xx.xx.xxx port 22: Operation timed out.
When I run the ssh command using -vvv i get:
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: /etc/ssh/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxx.xx.xx.xxx [xxx.xx.xx.xxx] port 22.
debug1: connect to address xxx.xx.xx.xxx port 22: Operation timed out
ssh: connect to host xxx.xx.xx.xxx port 22: Operation timed out
If you did a shutdown, IP of machine has been changed. Check it in the control panel.

How to send an email from a windows machine by using remote SMTP server (configured to run on localhost on Linux environment)?

I have an application running on Windows machine. the application related alerts are to be e-mailed to administrator,for which an e-mail needs to be sent by Java program. The SMTP server is configured on a remote Linux machine in network.
The Java Mail program works fine and sends out an email, when run on the Linux machine. However if the same program is run on Windows it fails to connect to the SMTP server.
Note:
Ping to the Linux Machine (having SMTP server) is successful from Remote windows server.
Telnet < SMTP server hostname > 25 fails from remote machine as well from the machine where SMTP is running
Telnet localhost 25 is sucessful from SMTP server (Linux server).
The email by Java program is sucessfull, if run on SMTP server when hostname is specified as localhost.It fails if you give actual hostname.
/etc/hosts file on SMTP server lists 127.0.0.1 localhost.
How can i use the SMTP server to send an email from remote Windows machine?
I can paste the errors coming up on windows machine but the problem is not with the program; its the way the SMTP server is configured. I am new to SMTP so feel free to correct me if i am wrong.
The objective is to send a java e-mail from remote windows machine using the SMTP server on the Linux machine.
Adding the Output of netstat -ant|grep :25 as requested in the comment below:
[root#XXXXXXXXXXX]# netstat -ant | grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
tcp 0 0 ::ffff:10.207.70.71:1521 ::ffff:10.207.70.71:25481 ESTABLISHED
tcp 0 0 ::ffff:10.207.70.71:25481 ::ffff:10.207.70.71:1521 ESTABLISHED
tcp 0 0 ::ffff:10.207.70.71:25202 ::ffff:10.207.70.71:3001 TIME_WAIT
tcp 0 0 ::ffff:10.207.70.71:25127 ::ffff:10.207.70.71:3001 TIME_WAIT
tcp 0 0 ::ffff:10.207.70.71:25289 ::ffff:10.207.70.71:3001 ESTABLISHED
tcp 0 0 ::1:51432 ::1:25580 ESTABLISHED
tcp 0 0 ::1:25580 ::1:51432 ESTABLISHED
tcp 0 0 ::ffff:10.207.70.71:25233 ::ffff:10.207.70.71:3001 TIME_WAIT
tcp 0 0 ::ffff:10.207.70.71:3001 ::ffff:10.207.70.71:25289 ESTABLISHED
[root#XXXXXXXXXXX]#
Postfix: Accepting SMTP connections on ALL IP interrfaces
Your SMTP server (postfix) accepts incoming SMTP connection only on loopback interface(s)
[IPv4=127.0.0.1 and IPv6=::1].
Make your postfix listen on all available IP interfaces -> in main.cf configuration file restore default setting inet_interfaces = all
http://www.postfix.org/postconf.5.html#inet_interfaces
Why "loopback only" configuration is used?
Limiting SMTP server to accept only local SMTP connections is pretty common default configuration on "workstations". It allows sending emails (e.g. system warnings/notifications) without accepting any incoming spam.

If the admin don't set the ssh service port on default 22, how can i find the port that he set? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
nmap can't do the work. I have checked that.
ps: I just use the basic nmap function(nmap host).
Oh, My god. Trust me i don't plan to do bad things. I am just curious! Please don't do -1!
update, use command: nmap -v -p1-65535 -sV
Scanning hidethehostaddress [2 ports]
Completed Ping Scan at 21:38, 0.00s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 21:38
Completed Parallel DNS resolution of 1 host. at 21:38, 0.00s elapsed
Initiating Connect Scan at 21:38
Scanning hidethehostaddress [65535 ports]
Connect Scan Timing: About 11.88% done; ETC: 21:43 (0:03:50 remaining)
Connect Scan Timing: About 32.96% done; ETC: 21:41 (0:02:04 remaining)
Completed Connect Scan at 21:40, 83.98s elapsed (65535 total ports)
Initiating Service scan at 21:40
Nmap scan report for hidethehostaddress
Host is up (0.080s latency).
Not shown: 65532 filtered ports
PORT STATE SERVICE VERSION
23/tcp closed telnet
80/tcp closed http
443/tcp closed https
Read data files from: /usr/share/nmap
Service detection performed. Please report any incorrect results at http://nmap.org /submit/ .
Nmap done: 1 IP address (1 host up) scanned in 84.13 seconds
It can:
nmap -v -p1-65535 -sV scanme.nmap.org

Resources