LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2023, 09:27 PM   #16
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by michaelk View Post
If the address you posted is your real public IP address then it appears you are running dropbear version 2018.76 and not openSSH?
IP was posted by accident, but has since been changed, ISP does that occasinally. According to the /etc/ssh/sshd_config it is OpenSSH
Quote:
# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21
 
Old 07-24-2023, 09:43 PM   #17
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,764

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
You might have both installed. Check running processes, netstat etc to see what is running. You can also probe the port with netcat (or telnet) and check the output on the system itself:

nc localhost 22

If openSSH is running you will see something like:
SSH-2.0-OpenSSH_9.2p1

Do the same thing using your public IP address.

Last edited by michaelk; 07-25-2023 at 04:32 AM.
 
Old 07-25-2023, 05:31 AM   #18
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by elgrandeperro View Post
First, if it asks for password, it isn't a firewall issue, it is getting there.
cop
How do you "switch key"? Just use -i to reference the private key. On the client, cd to .ssh, ssh -i krazy.rsa HOST. Or copy the private key to id_rsa.
I let securecrt accept and save the new key
 
Old 07-25-2023, 08:04 AM   #19
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
On the ssh server itself, "ssh krazy@locahost" and make sure that works. There are several local things that will make it fail silently (account lock, unapproved shell).

If that works, try from a remote host.

Check in the auth log, /var/log/auth.log or /var/log/secure.

Last edited by elgrandeperro; 07-25-2023 at 08:16 AM.
 
Old 07-25-2023, 11:11 AM   #20
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by elgrandeperro View Post
On the ssh server itself, "ssh krazy@locahost" and make sure that works. There are several local things that will make it fail silently (account lock, unapproved shell).

If that works, try from a remote host.

Check in the auth log, /var/log/auth.log or /var/log/secure.
Not home to try it ATM. But considering it works from within the lan (192.168.2.x) I can assure you localhost will work. Will try when I get home.
 
Old 07-25-2023, 02:56 PM   #21
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by michaelk View Post
You might have both installed. Check running processes, netstat etc to see what is running. You can also probe the port with netcat (or telnet) and check the output on the system itself:

nc localhost 22

If openSSH is running you will see something like:
SSH-2.0-OpenSSH_9.2p1

Do the same thing using your public IP address.
Doing this (NC localhost 22 and for my external IP displays the same thing SSH-2.0-OpenSSH_9.3
 
Old 07-25-2023, 03:10 PM   #22
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by elgrandeperro View Post
On the ssh server itself, "ssh krazy@locahost" and make sure that works. There are several local things that will make it fail silently (account lock, unapproved shell).

If that works, try from a remote host.

Check in the auth log, /var/log/auth.log or /var/log/secure.
This worked on the machine itself, but not when I tried using cell not on wifi I go into password failure loop even though it is correct. The /var/log/secure only show for sshd
Quote:
gkr-pam unable to locate daemon control file
gkr-pam stashed password to try later in open session
pam_unix(sshd:session): session opened for user krazy(uid=1000) by krazy
Doesn't look like external connection even hitting server.

Last edited by KrazyKanuk; 07-25-2023 at 05:51 PM.
 
Old 07-25-2023, 05:59 PM   #23
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
I think I found the problem.

Quote:
krazy@krazy:~$ nmap xx.xx.xx.xx
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-25 18:49 EDT
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.01 seconds

krazy@krazy:~$ nmap -Pn xx.xx.xx.xx
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-25 18:50 EDT
Nmap scan report for bras-base-stcton1066w-grc-04-xx-xx-xx-xx.dsl.bell.ca (xx.xx.xx.xx)
Host is up (0.017s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT STATE SERVICE
22/tcp closed ssh
2222/tcp closed EtherNetIP-1

Nmap done: 1 IP address (1 host up) scanned in 4.25 seconds
It shows port 22 and 2222 as closed even though I have port forwarded those 2 ports to 192.168.2.25 (IP address of the Slackware box), If they showing as closed would setting as a DMZ fix this? for it something on the ISP end if I have already set a port forward for the 2 ports.
 
Old 07-30-2023, 08:27 PM   #24
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
I think I am trying to perform an impossible task. Put the IP address in DMZ on the modem/router check https://www.infobyip.com/sshservertest.php on port 22, no go says cannot connect. change to an irregular port same thing went and got a dyndns address same thin on normal and irregular port. Think it is a done deal unless there is some other way to do it other then changing my ISP for I see that may be my only option to get this up and working. Thank you everyone for all your help it is greatly appreciated.
 
Old 07-30-2023, 09:29 PM   #25
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,764

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Your ISP may be blocking those ports but the typical ones are SMB/CIFS, 80 and 25. They should have a list posted somewhere.

You might be configuring port forwarding wrong. Make sure the from/to ports are the same as well as selecting TCP.

Usually ssh works with hair-pinning i.e. connecting from within your network using the public IP address with most routers so using your phone may not be required for testing. Just depends on how it is configured.

dyndns just assigns a fixed URL to your dynamic IP addressed using client software that updates their servers. It won't help if ssh does not work anyway.

Check your /etc/hosts.allow /etc/hosts.deny /etc/ssh/sshd_config files for anything that might limit ssh to listening only to your LAN. Does your sshd_config file have a specific ListenAddress or match directive to limit connections.
Use ss or netstat to check too for listening addresses on your server.
 
Old 07-31-2023, 07:42 PM   #26
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
Well it is fixed. You are not going to believe what the problem was. Well you probably will.

Quote:
My /etc/ssh/sshd_config where problem was

# Ciphers and keying
#RekeyLimit default none
Quote:
Changed it to

# Ciphers and keying
#RekeyLimit default none
Ciphers aes128-ctr
Said and done this fixed it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is ssh keys authentication more secure than password authentication? GrepAwkSed Linux - Security 6 03-17-2012 08:25 PM
[SOLVED] SSH no route to host error. can ssh outside lan, but not to clients on lan... jmd9qs Linux - Networking 3 01-21-2012 10:28 AM
SSH host keys VS SSH keys kenneho Linux - Security 3 09-11-2008 06:03 AM
ssh works good from LAN but can't login from WAN akrawiec Linux - Security 4 01-10-2007 02:03 PM
FreeS/Wan Vs. OpenS/Wan Vs. StrongS/Wan bkankur Linux - Security 1 03-01-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration