Page 1 of 1
ssh insanity with Bionic pup 64
Posted: Tue Dec 29, 2020 7:42 pm
by haywirepc
I am having a hell of a time trying to get ssh to work as a host. Using Ubuntu Bionic 64 on most of my workstations.
Installed openssh client and server. Seems like it works client wise to non puppy machines, but no matter what I try puppy does not want to seem to be a host or allow ssh connections. There was missing files sshd_config, so I gathered a sample file and put it in /ect/ssh/.
I checked the firewall, disabled the firewall completely, same issues. If I try and restart the ssh server with the command /etc/init.d/ssh start I get this :
* Starting OpenBSD Secure Shell server sshd
/etc/ssh/sshd_config line 6: Deprecated option ServerKeyBits
/etc/ssh/sshd_config line 8: Deprecated option KeyRegenerationInterval
/etc/ssh/sshd_config line 17: Deprecated option RhostsAuthentication
/etc/ssh/sshd_config line 18: Deprecated option RhostsRSAAuthentication
/etc/ssh/sshd_config line 19: Deprecated option RSAAuthentication
typing ssh localhost in terminal gets : ssh: connect to host localhost port 22: Connection refused
Try stopping and restarting, same message. Connections to non puppy linux machines? Work fine. So I guess the client side is fine but the host is borked somehow. Does anyone know a way to fix this? I have 7 puppy linux machines in my house. I'd l ike to be able to ssh into each of them.
I love puppy linux for its speed, snappiness and responsiveness, but things like this really get irritating. ssh is an important system tool that should just work without days of troubleshooting and hair pulling. Been googling trying to resolve this for days. What bothers me is ssh? It works fine out of the box with any other distro I've used.
Please someone help me troubleshoot and get this working, I don't want to have to upgrade 7 computers in my house just to be able to use ssh on each of them. But on that note, does SSH work out of the box with Ubuntu Focal 64? Maybe it is time to just upgrade, build a new workstation core and clone it to all my machines...
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 9:07 pm
by s243a
Look on the files:
/etc/hosts.allow
/etc/hosts.deny
google is your friend here.
https://www.crybit.com/allow-ssh-connection-on-server/
Also start the ssh server in non-daemon mode (-D option I think for non-detarch).
-D' When this option is specified, sshd will not detach and does not become a daemon. This allows easy monitoring of sshd.
-d' Debug mode. The server sends verbose debug output to the system log, and does not put itself in the background. The server also will not fork and will only process one connection. This option is only intended for debugging for the server. Multiple -d options increase the debugging level. Maximum is 3.
https://linux.die.net/man/8/sshd
Use -vvv on the ssh client for high verbosity.
-v' Verbose mode. Causes ssh to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems. Multiple -v options increase the verbosity. The maximum is 3.
https://linux.die.net/man/1/ssh
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 9:15 pm
by haywirepc
Thanks for your help. Seems like no matter what I do, sshd will not start. I think this is just a bad build of ssh server or missing config files or something
important just not there.
root# service ssh start
* Starting OpenBSD Secure Shell server sshd [ OK ]
root# service ssh status
* sshd is not running
root#
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 9:30 pm
by haywirepc
Hosts.allow file = ALL: ALLOW
Hosts.deny file = ALL: ALLOW
Does anyone have any insight into why SSHD refuses to run?
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 9:56 pm
by s243a
haywirepc wrote: Tue Dec 29, 2020 9:15 pm
Thanks for your help. Seems like no matter what I do, sshd will not start. I think this is just a bad build of ssh server or missing config files or something
important just not there.
root# service ssh start
* Starting OpenBSD Secure Shell server sshd [ OK ]
root# service ssh status
* sshd is not running
root#
Use the sshd command to start the server:
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 10:06 pm
by haywirepc
Tried that earlier, get an error message, requires execution with an absolute path. I'm not sure what that means.
root# sshd -D
sshd re-exec requires execution with an absolute path
root#
Any idea the path or better command to call it from?
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 10:08 pm
by Trapster
Where did you get the Openssh server file from and how did you install it?
To find the path, do:
in the console.
If the result is /usr/sbin/sshd, run in console:
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 10:27 pm
by Trapster
Here is my sshd_config, note the commented and uncommented lines.
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
AllowUsers root spot
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
XAuthLocation /usr/bin/xauth
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 11:33 pm
by haywirepc
I copied your file to sshd_config in /ect/ssh
root# ssh localhost
ssh: connect to host localhost port 22: Connection refused
root# service ssh status
* sshd is not running
root# service ssh start
* Starting OpenBSD Secure Shell server sshd Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
[ OK ]
root# ssh localhost
Connection reset by 127.0.0.1 port 22
root#
If I try and run it as you said I get this
/root# which sshd
/usr/sbin/sshd
root# /usr/sbin/sshd -D
Seems like something runs, then the prompt returns, no error message, but when I try ssh localhost now I get the error message above.
After running the command your way, ssh service status locks the terminal, cursor not returned. Tried it again and for the first time I get :
root# which sshd
/usr/sbin/sshd
root# /usr/sbin/sshd -D
root# service ssh status
* sshd is running
root#
Then when trying to ssh to localhost I get :
root# ssh localhost
Connection reset by 127.0.0.1 port 22
root#
Getting closer, I guess now its a port issue. Can anyone please help me diagnose and fix this last part?
I desperately want to get this working. Been at this for days. This is the closest I have been!
Re: ssh insanity with bionic pup 64
Posted: Tue Dec 29, 2020 11:37 pm
by haywirepc
Also I don't see an /var/log/auth file as suggested by some sites and forums discussing this issue, but in messages I found this :
Dec 29 18:22:08 ALTOSALPHA2 user.notice root: /usr/sbin/pkg Repo files updated by 1.9.22
Dec 29 18:23:10 ALTOSALPHA2 auth.err sshd[8120]: error: Bind to port 22 on 192.168.1.1 failed: Cannot assign requested address.
Dec 29 18:23:10 ALTOSALPHA2 auth.crit sshd[8120]: fatal: Cannot bind any address.
Dec 29 18:23:49 ALTOSALPHA2 daemon.info dbus-daemon[6801]: [session uid=0 pid=6799] Activating service name='org.gtk.vfs.Metadata' requested by ':1.36' (uid=0 pid=6817 comm="Thunar --daemon ")
Dec 29 18:23:49 ALTOSALPHA2 daemon.info dbus-daemon[6801]: [session uid=0 pid=6799] Successfully activated service 'org.gtk.vfs.Metadata'
Dec 29 18:24:52 ALTOSALPHA2 auth.info sshd[8414]: Server listening on 0.0.0.0 port 22.
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:25:03 ALTOSALPHA2 auth.crit sshd[8442]: fatal: No supported key exchange algorithms [preauth]
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:29:37 ALTOSALPHA2 auth.crit sshd[9052]: fatal: No supported key exchange algorithms [preauth]
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:33:11 ALTOSALPHA2 auth.crit sshd[9566]: fatal: No supported key exchange algorithms [preauth]
Re: ssh insanity with bionic pup 64
Posted: Wed Dec 30, 2020 12:04 am
by s243a
haywirepc wrote: Tue Dec 29, 2020 11:37 pm
Also I don't see an /var/log/auth file as suggested by some sites and forums discussing this issue, but in messages I found this :
Dec 29 18:22:08 ALTOSALPHA2 user.notice root: /usr/sbin/pkg Repo files updated by 1.9.22
Dec 29 18:23:10 ALTOSALPHA2 auth.err sshd[8120]: error: Bind to port 22 on 192.168.1.1 failed: Cannot assign requested address.
Dec 29 18:23:10 ALTOSALPHA2 auth.crit sshd[8120]: fatal: Cannot bind any address.
Dec 29 18:23:49 ALTOSALPHA2 daemon.info dbus-daemon[6801]: [session uid=0 pid=6799] Activating service name='org.gtk.vfs.Metadata' requested by ':1.36' (uid=0 pid=6817 comm="Thunar --daemon ")
Dec 29 18:23:49 ALTOSALPHA2 daemon.info dbus-daemon[6801]: [session uid=0 pid=6799] Successfully activated service 'org.gtk.vfs.Metadata'
Dec 29 18:24:52 ALTOSALPHA2 auth.info sshd[8414]: Server listening on 0.0.0.0 port 22.
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:25:03 ALTOSALPHA2 auth.err sshd[8442]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:25:03 ALTOSALPHA2 auth.crit sshd[8442]: fatal: No supported key exchange algorithms [preauth]
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:29:37 ALTOSALPHA2 auth.err sshd[9052]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:29:37 ALTOSALPHA2 auth.crit sshd[9052]: fatal: No supported key exchange algorithms [preauth]
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 29 18:33:11 ALTOSALPHA2 auth.err sshd[9566]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 29 18:33:11 ALTOSALPHA2 auth.crit sshd[9566]: fatal: No supported key exchange algorithms [preauth]
Do the following command:
https://www.ssh.com/ssh/keygen/
hit enter when it asks for a password. Host keys can't have a password. When it asks for a path put the keys in "/etc/ssh".
Re: ssh insanity with bionic pup 64
Posted: Wed Dec 30, 2020 12:06 am
by s243a
haywirepc wrote: Tue Dec 29, 2020 11:33 pm
If I try and run it as you said I get this
/root# which sshd
/usr/sbin/sshd
root# /usr/sbin/sshd -D
Seems like something runs, then the prompt returns, no error message, but when I try ssh localhost now I get the error message above.
Maybe try this instead then:
The small "d" is for debugging. The "e" option tells it to send errors to standard error. I'm not sure if you can use all these options at once.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 12:46 am
by haywirepc
Thanks for all your help and kind assistance. This is driving me mad. So close now, I think its an issue with the keys.
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root#
Can you explain again how to generate these keys? Seems like it did this when I tried to specify /ect/ssh/filename
What is the exact filename? maybe I got it wrong? So close this is frustrating!
ssh-keygen -t ecdsa -b 521
Generating public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa): /ect/ssh/id_ecdsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "/ect/ssh/id_ecdsa" failed: No such file or directory
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:00 am
by s243a
haywirepc wrote: Wed Dec 30, 2020 12:46 am
Thanks for all your help and kind assistance. This is driving me mad. So close now, I think its an issue with the keys.
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root#
Can you explain again how to generate these keys? Seems like it did this when I tried to specify /ect/ssh/filename
What is the exact filename? maybe I got it wrong? So close this is frustrating!
ssh-keygen -t ecdsa -b 521
Generating public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa): /ect/ssh/id_ecdsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "/ect/ssh/id_ecdsa" failed: No such file or directory
You spelled the directory wrong. It is "etc" not "ect" make sure it exists. If it doesn't you can create it with the following command:
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:07 am
by haywirepc
I was hoping you were right and it was something dumb like that, apparently not so.
root# ssh-keygen -t ecdsa -b 521
Generating public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa): /etc/ssh/id_ecdsa
/etc/ssh/id_ecdsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/id_ecdsa.
Your public key has been saved in /etc/ssh/id_ecdsa.pub.
The key fingerprint is:
SHA256:evMurclYQQQPVX+3W0WoVNkpPGsg2mkc4SmLb5ipunc root@ALTOSALPHA2
The key's randomart image is:
+---[ECDSA 521]---+
| ooooo ...+o|
| +.o.o.+oo.|
| .*o+.o.= o|
| .oo= .+ .o|
| . .S . ..|
| =. . o|
| +.o+. . |
| ..E.=.+. |
| o+.. . ++o |
+----[SHA256]-----+
root#
root# ssh localhost
Connection reset by 127.0.0.1 port 22
root# service ssh status
* sshd is running
root# service ssh stop
* Stopping OpenBSD Secure Shell server sshd [ OK ]
root# service ssh restart
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
* Restarting OpenBSD Secure Shell server sshd Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
[ OK ]
root# service ssh status
* sshd is running
root# ssh localhost
Connection reset by 127.0.0.1 port 22
root#
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:15 am
by haywirepc
So it appears the issues preventing connection are the keys. I tried several times to generate them as you described. Still getting these errors.
Files in ect/ssh =
/etc/ssh/id_ecdsa
/etc/ssh/id_ecdsa.pub
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/ssh/ssh_host_key
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root#
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:19 am
by s243a
haywirepc wrote: Wed Dec 30, 2020 1:15 am
So it appears the issues preventing connection are the keys. I tried several times to generate them as you described. Still getting these errors.
Files in ect/ssh =
/etc/ssh/id_ecdsa
/etc/ssh/id_ecdsa.pub
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/ssh/ssh_host_key
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root#
Rename the following files:
Code: Select all
/etc/ssh/id_ecdsa
/etc/ssh/id_ecdsa.pub
to
Code: Select all
/etc/ssh/ssh_host_ecdsa_key
/etc/ssh/ssh_host_ecdsa_key.pub
also you have to kill the process which is listening on port 22.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:29 am
by haywirepc
Stil getting errors. 2 days on this so far. very frustrating. ready to give up but I know its close to resolved, sshd seems to be looking for key files or filenames that are not there. I though generating the keys should tell it what the keys are, apparently not. I have no idea whats already using port 22,
nothing looks wrong that I could find.
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: private host key #1: ecdsa-sha2-nistp521 SHA256:evMurclYQQQPVX+3W0WoVNkpPGsg2mkc4SmLb5ipunc
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root#
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:44 am
by s243a
haywirepc wrote: Wed Dec 30, 2020 1:29 am
Stil getting errors. 2 days on this so far. very frustrating. ready to give up but I know its close to resolved, sshd seems to be looking for key files or filenames that are not there.
The following line suggests that it found the host key:
Code: Select all
debug1: private host key #1: ecdsa-sha2-nistp521 SHA256:evMurclYQQQPVX+3W0WoVNkpPGsg2mkc4SmLb5ipunc
the ssh server only needs one type of host key unless it needs to allow clients to connect that are using different types of keys, in which case you should generate all types of keys. Provided both the server and client are using the ecdsa key then one key type is sufficient.
I chose the ecdsa key type because it sounded the best when I read about it at:
https://www.ssh.com/ssh/keygen/
I though generating the keys should tell it what the keys are, apparently not. I have no idea whats already using port 22,
nothing looks wrong that I could find.
Google:
"google how to find what process is listening on a port linux"
This link comes up:
https://www.cyberciti.biz/faq/what-proc ... inux-port/
From the commands get the process id and then go
where pid is the process id.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:52 am
by haywirepc
Thanks again for your help. so frustrating, seems almost fixed, but not fixed. aaargh...
Spoke too soon. after reboot - Can connect to localhost now! But when I try from another puppy linux machine to connect (ssh ALTOSALPHA2) it
just times out. Do I need to repeat this whole process on every machine in my network? That could take awhile, but I'll do it if it fixes this issue I suppose. Not even sure all the steps to take, but I can follow this thread. Thanks for your kind assistance. I think its mostly there now, just have to figure out why remote machines won't connect I suppose. Just tried a linux mint live dvd on a spare computer... tried to ssh to this pc (altosalpha2) no go. It says could not resolve hostname altosalpha2 name or service not known.
Latest from terminal :
root# /usr/sbin/sshd -deD
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n 7 Dec 2017
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
debug1: private host key #1: ecdsa-sha2-nistp521 SHA256:evMurclYQQQPVX+3W0WoVNkpPGsg2mkc4SmLb5ipunc
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_ed25519_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-deD'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
socket: Address family not supported by protocol
Cannot bind any address.
root# ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:evMurclYQQQPVX+3W0WoVNkpPGsg2mkc4SmLb5ipunc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
xrandr: unrecognized option '1440x900_60.00'
Try 'xrandr --help' for more information.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 2:05 am
by s243a
haywirepc wrote: Wed Dec 30, 2020 1:52 am
Thanks again for your help. so frustrating, seems almost fixed, but not fixed. aaargh...
Spoke too soon. after reboot - Can connect to localhost now! But when I try from another puppy linux machine to connect (ssh ALTOSALPHA2) it
just times out. Do I need to repeat this whole process on every machine in my network? That could take awhile, but I'll do it if it fixes this issue I suppose. Not even sure all the steps to take, but I can follow this thread. Thanks for your kind assistance. I think its mostly there now, just have to figure out why remote machines won't connect I suppose. Just tried a linux mint live dvd on a spare computer... tried to ssh to this pc (altosalpha2) no go. It says could not resolve hostname altosalpha2 name or service not known.
On the machine running the ssh server, do the following command:
in order to find your ip adress.
You should see something like, "inet addr:192.168.1.56", where 192.168.1.56 is the ip adress. Assuming this is the ip adress that you found then on the client ssh as follows:
**Note, I'm assuming that both machines are on the same local network and the firewall isn't blocking the connection.
Try this first then later you can try adding x11forwarding options such as "-X" untrusted and "-Y" trusted. These will only work if your configuration file is set up to allow them to work. See:
https://linux.die.net/man/1/ssh
https://linux.die.net/man/5/ssh_config
https://linux.die.net/man/8/sshd
https://linux.die.net/man/5/sshd_config
Anyway, once you get the above working consider trying to get key based authentication working for better security.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 2:20 am
by haywirepc
Thank you so much! Huge problem, finally solved after a few days. Wish I'd posted here sooner. You have my gratitude, for real. Didn't think I would be able to fix this, was ready to give up and use linux mint on all my machines but that is so slow once you've gotten used to puppy linux.
, I was able to connect to my main machine (ALTOSALPHA2) from both another puppy linux machine and the linux mint live boot on a laptop.
I'm fine with just using the ip. Not sure why I didn't think of that, I suppose in the past I've just used hostnames with no issues.
Thanks so much! Now one last question, what happens if I clone this save file to the other computers, then change the host names for each? Will I have to renegerate the keys for each as you showed in this thread?
Thanks again! So happy this is working!
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 2:30 am
by s243a
haywirepc wrote: Wed Dec 30, 2020 2:20 am
Thank you so much! Huge problem, finally solved after a few days. Wish I'd posted here sooner. You have my gratitude, for real. Didn't think I would be able to fix this, was ready to give up and use linux mint on all my machines but that is so slow once you've gotten used to puppy linux.
, I was able to connect to my main machine (ALTOSALPHA2) from both another puppy linux machine and the linux mint live boot on a laptop.
I'm fine with just using the ip. Not sure why I didn't think of that, I suppose in the past I've just used hostnames with no issues.
Thanks so much! Now one last question, what happens if I clone this save file to the other computers, then change the host names for each? Will I have to renegerate the keys for each as you showed in this thread?
Thanks again! So happy this is working!
You can use the same keys on different machines (either host or client) but the ssh clients and servers will note that it looks suspicious until you accept the new connection for the first time. Having unique keys identifies the clients and servers as unique and provides better security.
I'm glad that you got it working. From this thread it seems like there is a bit of a learning curve. As a side note, I think that your ssh server is starting up at boot and that is why the sshd command says that it can't bind to port 22. This is likely because you started it with the "service" command.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 2:32 am
by haywirepc
P.S. yes the X forwarding is already on. I work on film to digital restoration projects sometimes, so my interest in multiple machines is using ssh+x forwarding to run kdenlive and render out finished edited projects on the other computers on my network. Otherwise, its pretty slow going. If things work out I should be able to render 5 or 6 projects at once, which is great because each can take hours. Most of the projects all need the same thing, color correction, auto exposure, sharpening, format change from 4:3 to 16:9, so the edits go real quick, but the renders take ages if your just using one computer...
Thanks to your kind assistance, I should be able to use this entire network more get more work done. Can't thank you enough.
Most of my computers are all older junkers, but with some geeking around, and methods like this, I manage to get great things accomplished.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 1:33 pm
by mikewalsh
@haywirepc , @s243a :-
A marvellous demonstration of how Pup can help solve problems - even with older hardware - and also of the importance of this community of ours. Great stuff, both of you.
Having read right the way through, I was already thinking along the lines of 'router, IP addys, firewall' by halfway through page 2, rather than auto-generated keys, etc. I know it's somewhat different, but I remember having issues at times with Bill's lightweight "Samba-TNG" fork back in the days of the old forum.....and THAT was all down to the basic 'nitty-gritty' of the LAN's 'internal' connections, and my not, initially, understanding quite what was going on, and what was needed.
I've always thought of SSH as a 'grown-up' version of SAMBA, with greater versatility and higher levels of security...
(*shrug*)
Mike.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 3:15 pm
by haywirepc
I have been using puppy linux with older pc's for about 10 years now. A big issue for me is if it breaks can I fix it. I have found yes you usually can fix it, especially with some kind people in the forums helping you with the bigger issues you can't solve on your own. My other go to fix is to make backups of the save file. You can always go back and start again if you bork something.
I'll try and pay it forward by helping some other users here. I'm sure happy this issue of mine was resolved. I am now rendering projects across the network. That should help speed this project along nicely.
Re: ssh insanity with Bionic pup 64
Posted: Wed Dec 30, 2020 3:43 pm
by mikewalsh
@haywirepc :-
Nah, like I said.....it's great stuff. Like you, I'm really, REALLY glad I discovered Puppy 6 or 7 years ago; it's been my 'daily driver' for over 5 years now. Couldn't imagine life without it.....nor without this amazing community of ours. And I do everything I possibly can to help others get the best out of it, too.
I'll try and pay it forward by helping some other users here.
Nice one. We'll hold ya to that....
Puppy roolz!! Yes!!!
Mike.