Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => dCore X86 => dCore x86 Imported Extensions => Topic started by: blinklet on May 31, 2016, 11:03:23 AM

Title: Install and run SSH in dCore?
Post by: blinklet on May 31, 2016, 11:03:23 AM
Hi,
I've been working with dCore for a few weeks. I cannot get SSH (or any service) to start in dCore.

I import and load SSH
$ sudo sce-import ssh
$ sudo sce-load ssh

Then I start the ssh server with the command
$ sudo /etc/init.d/ssh start

I see no error message but SSH does not start.
netstat -an command does not show tcp listening to any ports
ps -ef command shows ssh is not running.

How do I get ssh server working in dcore?

Note: I also tried dropbear
Dropbear works. But why won't standard SSH server work? I am trying to get network services working and SSH is the first attempt. I also cannot get quagga daemons to work but thought starting with SSH would be a simpler case to solve...

Any help is appreciated.

Thanks,
Brian
Title: Re: Install and run SSH in dCore?
Post by: Jason W on May 31, 2016, 11:15:51 AM
Which dCore port are you using?  I have ssh running and log into my box remotely all the time.
Title: Re: Install and run SSH in dCore?
Post by: blinklet on May 31, 2016, 12:18:37 PM
I am amusing dCore xenial from the release candidates.
Which version are you using?
Title: Re: Install and run SSH in dCore?
Post by: Jason W on May 31, 2016, 12:49:13 PM
I have used ssh on all the others.  I will boot dCore-xenial and see what is happening.  .
Title: Re: Install and run SSH in dCore?
Post by: blinklet on May 31, 2016, 06:01:17 PM
If it makes a difference, I am running dCore in a virtual machine (VirtualBox).
Title: Re: Install and run SSH in dCore?
Post by: Jason W on May 31, 2016, 07:38:29 PM
Oh, ok.  I will check that out and see if there is anything I can do.
Title: Re: Install and run SSH in dCore?
Post by: blinklet on June 03, 2016, 09:12:18 AM
I imported, loaded, and started OpenSSH (the ssh package) in dCore-jessie and it worked.
So maybe a xenial issue?
Title: Re: Install and run SSH in dCore?
Post by: Jason W on June 03, 2016, 12:19:58 PM
It appears to be a dependency list issue regarding dCore-xenial, at least when used on a virtual machine though that should not matter.  I have ssh working on it, I will test some more before I ask you to try it again on a fresh VM session.
Title: Re: Install and run SSH in dCore?
Post by: Jason W on June 03, 2016, 12:46:25 PM
"sce-import ssh && sudo /etc/init.d/ssh start" is working fine in a Virtualbox session of dCore-xenail.  "pgrep ssh" and "netstat -an" give expected results.  Please re-test.
Title: Re: Install and run SSH in dCore?
Post by: blinklet on June 05, 2016, 09:09:52 AM
Thanks. I will try again.
Title: Re: Install and run SSH in dCore?
Post by: blinklet on June 06, 2016, 05:27:52 PM
I tried this again on dCore xenial and it worked. I don't know what was wrong before... but it works now.
Thanks for looking into this.
Brian
Title: Re: Install and run SSH in dCore?
Post by: Jason W on June 06, 2016, 07:11:35 PM
Simply missing dependencies as our dep gathering routine differs from Debian/Ubuntu, we can add them on our end.  Thanks for your time and testing.
Title: Re: Install and run SSH in dCore?
Post by: donquixote2u on August 02, 2016, 09:38:13 PM
I've got frustrated with broken dependencies in the Tiny Core extensions, and so I'll have a go at mastering the art of package builds when I have a spare day or five! 

Meanwhile i've turned to dCore and the good old Debian repos as an alternative, and it's worked a treat;  so thank you Jason for your work on a brilliant fork.

But now having installed openssh-server I'm having trouble making its config persistent;  I had to "sudo passwd tc" to set a password the client could enter, but I can't work out how to hold it. Some users of TC suggested /usr/local/etc needed to be in /opt/filetool.lst but that doesn't seem to even exist in dCore;

Can anyone help me with the correct folders I need to back up to keep my ssh server available on reboot?
Title: Re: Install and run SSH in dCore?
Post by: Onyarian on August 03, 2016, 12:44:52 AM
Hi,
/etc/shadow and /etc/passwd in /opt/.filetool.lst if I'm not wrong.

That's for dCore-trusty (Ubuntu versión of dCore),  you don't say wich version of dCore are you using.

Enviado desde mi D5503 mediante Tapatalk
Title: Re: Install and run SSH in dCore?
Post by: donquixote2u on August 03, 2016, 02:17:54 AM
Hi,
/etc/shadow and /etc/passwd in /opt/.filetool.lst if I'm not wrong.

That's for dCore-trusty (Ubuntu versión of dCore),  you don't say wich version of dCore are you using.

Enviado desde mi D5503 mediante Tapatalk

ah, that's what I thought - sorry for not specifying,  my version is Jessie, but same locations there;  I think I'd tried them, but didn't seem to work, I'll have another play with them.  Thanks for replying.   
Title: Re: Install and run SSH in dCore?
Post by: donquixote2u on August 03, 2016, 03:07:34 PM
update - can't seem to get the filetool.lst to work, but backing up those files + the ssh keys on to /opt and copying them back again in /opt/bootlocal.sh before starting the ssh server works.

so files are: /etc/passwd /etc/shadow, and the whole /etc/ssh directory

Title: Re: Install and run SSH in dCore?
Post by: Greg Erskine on August 03, 2016, 05:37:14 PM
Hi donquixote2u,

The file is /opt/.filetool.lst

The file should look a bit like this, note the absence of leading slashes.

Code: [Select]
tc@piCore:/opt$ cat .filetool.lst
opt
home
etc/passwd
etc/shadow
etc/group
etc/gshadow
etc/motd
etc/modprobe.conf
etc/asound.conf
usr/local/etc/pointercal
usr/local/etc/ssh/ssh_host_dsa_key
usr/local/etc/ssh/ssh_host_dsa_key.pub
usr/local/etc/ssh/ssh_host_ecdsa_key
usr/local/etc/ssh/ssh_host_ecdsa_key.pub
usr/local/etc/ssh/ssh_host_ed25519_key
usr/local/etc/ssh/ssh_host_ed25519_key.pub
usr/local/etc/ssh/ssh_host_rsa_key
usr/local/etc/ssh/ssh_host_rsa_key.pub
usr/local/etc/init.d/squeezelite
usr/local/etc/init.d/httpd
usr/local/etc/init.d/shairport-sync
usr/local/sbin/config.cfg
usr/local/sbin/piversion.cfg
usr/local/sbin/setup
usr/local/sbin/pcp
usr/local/sbin/pcp-load
var/lib/alsa/asound.state
var/spool/cron/crontabs
usr/local/etc/lirc/lircd.conf
home/tc/.lircrc

I use piCore, but I think it applies to all versions.

regards
Greg
Title: Re: Install and run SSH in dCore?
Post by: Jason W on July 23, 2017, 07:42:41 AM
I have changed the openssh-server startup script to not run "ssh-keygen -A" upon extension loading, and this is also how the startup of openssh.tcz in the regular Tinycore repo behaves upon looking at its startup script. 

Before starting the SSH server, run as root "ssh-keygen -A" and then back up the /etc/ssh directory to save the generated key files.  Or use the specific commands to generate the desired keys:

ssh-keygen -A   (will create dsa, ecdsa, rsa, and ed25519 keys)
ssh-keygen -t dsa
ssh-keygen -t ecdsa
ssh-keygen -t ed25519
ssh-keygen -t rsa
ssh-keygen -t rsa1

Other files to back up such as to keep the same user and password are mentioned in other posts in this thread. 

The ssh server is started with the below command -

/etc/init.d/ssh start