Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: mc006 on July 28, 2010, 06:12:24 PM

Title: openssh connection refused
Post by: mc006 on July 28, 2010, 06:12:24 PM
Hi,
I have installed openssh, i.e. client and server. when i try to test and execute ssh localhost, i get error saying connection refused. How do i check if ssh server is running and listening on port 22. where is the config file.
when i do df -h i can see entry /dev/loop43 /tmp/tcloop/openssh

Thanks

Title: Re: openssh connection refused
Post by: althalus on July 28, 2010, 07:42:41 PM
A fair indication of whether SSH is running:
Code: [Select]
ps aux | grep sshdIs something running on port 22?
Code: [Select]
netstat -at | grep -e "22\|ssh"Netstat can also be coerced to show what application is using what port, but I'll leave that as an excercise to the reader (hint: Google) (It may also require the full netstat, rather than the busybox version)

Config files for applications will more often than not be in /usr/local/etc, so for SSH I'd check /usr/local/etc/ssh

The init script (if the application has one) will similarly usually appear in /usr/local/etc/init.d

TC doesn't (usually) start applications by default, that's what the /home/tc/.X.d folder and /opt/bootlocal.sh are for. (.X.d for desktop applications (conky, pigin, etc) and bootlocal.sh for services (ssh, apache, etc))
Title: Re: openssh connection refused
Post by: ophiry on July 29, 2010, 01:09:21 AM
Indeed, sshd doesn't start automatically when installed.
I believe there's a boot code that will start the daemon automatically, or you can add it to bootlocal.sh.

before starting the daemon, you may need a few other steps:
1. create keys for the daemon
2. by default sshd doesn't allow users with no password (such as tc) or the root user to login.
you'll need to either override these limitations in the configuration files, or add\modify the users.

Ophir
Title: Re: openssh connection refused
Post by: ^thehatsrule^ on July 29, 2010, 02:24:29 AM
I believe there's a boot code that will start the daemon automatically [...]
That was removed (a while ago)
Title: Re: openssh connection refused
Post by: mc006 on July 29, 2010, 04:04:47 AM
Hi,
thanks i got it working now....
by default when try to start openssh using ./openssh start, it looks for sshd_config file which you can create by cp the sshd_config.example file. The issue is that when it does not find the sshd_config file it displays the error output stating that there is no sshdd_config file.....this is where the error is it should state sshd_config and not sshdd_config....minor error...

Thanks
Title: Re: openssh connection refused
Post by: tinypoodle on July 29, 2010, 11:18:29 AM
Netstat can also be coerced to show what application is using what port, but I'll leave that as an excercise to the reader (hint: Google) (It may also require the full netstat, rather than the busybox version)
Works fine with busybox  ;)
Option is "-p"
Title: Re: openssh connection refused
Post by: cparke on April 03, 2025, 09:28:01 AM
Hi,
thanks i got it working now....
by default when try to start openssh using ./openssh start, it looks for sshd_config file which you can create by cp the sshd_config.example file. The issue is that when it does not find the sshd_config file it displays the error output stating that there is no sshdd_config file.....this is where the error is it should state sshd_config and not sshdd_config....minor error...

Thanks
This message may be 15 years later, but believe it or not I am seeing this exact same issue on the latest Tinycore (16.0).  Sshd won't start until that missing configuration file is created.  Furthermore, outgoing SSH/SCP/SFTP are failing with a strange error message for me. Putty is the work around, that works.. Quite surprising that such a simple and commonly used tool doesn't work in Tinycore even after so much time!
Title: Re: openssh connection refused
Post by: Rich on April 03, 2025, 11:35:32 AM
Hi cparke
... Quite surprising that such a simple and commonly used tool doesn't work in Tinycore even after so much time!
It does work. The end user can either copy the included config file
example, or create one that meets their needs.

The error message is a reminder that it's your job to figure out how
you need openssh configured. There's no universal config file that
will meet everyones needs, so a default is not placed where openssh
would find it.
Title: Re: openssh connection refused
Post by: cparke on April 06, 2025, 05:03:47 PM
The error message is a reminder that it's your job to figure out how
you need openssh configured. There's no universal config file that
will meet everyones needs, so a default is not placed where openssh
would find it.
ssh now working with the config file in place.  The error message isn't very descriptive of the problem, which is why this came up again with me.

However, I still am having similar problems with sftp and scp.  I thought these use the same config file, or not?

I'm getting this:

Code: [Select]
tc@TinyCorePure64:~$ sftp 192.168.0.100
192.168.0.100's password:
client_loop: send disconnect: Broken pipe
Connection closed. 
Connection closed
tc@TinyCorePure64:~$

Any clue how to fix that too?
Title: Re: openssh connection refused
Post by: Rich on April 06, 2025, 10:31:38 PM
Hi cparke
This worked for me.

Server machine 192.168.1.35
User name Rich
Code: [Select]
sudo cp /usr/local/etc/ssh/sshd_config.orig /usr/local/etc/ssh/sshd_config
sudo /usr/local/etc/init.d/openssh start
sudo chpasswd
Rich:PASSWORD

Client machine:
Code: [Select]
tc@box:~$ sftp Rich@192.168.1.35
Rich@192.168.1.35's password:
Connected to 192.168.1.35.
sftp> exit
tc@box:~$
Title: Re: openssh connection refused
Post by: cparke on April 07, 2025, 09:16:50 AM
There's something more to it, that is simply not working for me.
Title: Re: openssh connection refused
Post by: Rich on April 07, 2025, 09:36:45 AM
Hi cparke
After going through your previous threads/posts I realized you were
also looking into some chroot related stuff.

See if this and the link they provide helps:
https://www.linuxquestions.org/questions/linux-server-73/cannot-connect-via-sftp-always-get-broken-pipe-4175681969/