Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: lid on September 03, 2012, 05:34:10 PM

Title: How to enable telnet in pxebooted core?
Post by: lid on September 03, 2012, 05:34:10 PM

Hi,

I am new to tinycore Linux.  I downloaded the minimal image Core-current.iso and used pxeboot to boot it up in RAM in a diskless box.  By default I was dropped into the "tc" account without passwd.  Networking worked just fine.

However I 'd like to log into the box remotely. So I tried telnet but the connection was refused.  I searched the forum and found this post:

http://forum.tinycorelinux.net/index.php/topic,11430.msg60419.html#msg60419

However my situation might be different. I don't have /usr/local/sbin/telnetd. Instead I have /usr/sbin/inetd (Busybox link). I am not sure why this post asked me to put this line in /etc/inetd.conf file:

telnet stream tcp nowait root /usr/local/sbin/telnetd telnetd

The connection still was refused after I did this:
/usr/sbin/inetd /etc/inetd.conf

Any ideas?

David
Title: Re: How to enable telnet in pxebooted core?
Post by: gerald_clark on September 03, 2012, 05:42:40 PM
You need to spend some time in the wiki reading about installing packages, and persistence.
Title: Re: How to enable telnet in pxebooted core?
Post by: lid on September 04, 2012, 06:29:39 AM
Thanks for the reminder.

My microcore doesn't have 'ab' command. Maybe it's the smallest package in tinycore Linux.
I did find tce-load tool and used it to download and installed "sshd".  It's nice tool! So this solved my remote login issue.

Since my box is diskless and I booted everything into RAM so there is no persistent storage for my sshd files.  If sshd should survive the reboots, then I will have to package them into the core.gz.  I haven't found anything in wiki how to do this yet.  Please let me know if you have a link.

David
Title: Re: How to enable telnet in pxebooted core?
Post by: ananix on September 04, 2012, 06:44:33 AM
If you boot from USB (writable media) you could add the files in question to your /opt/.filetool after changes run backup and they will now be in mydata.tgz extracted at boot. If from CDROM you have to do a remaster forinstance with ezremaster.
Depending on your boot media and how you "loaded" sshd the package will still be availble in /opt/optional after boot as it default also backedup maybe just adding it to onboot.lst will do the job you are asking.
Title: Re: How to enable telnet in pxebooted core?
Post by: ananix on September 04, 2012, 07:20:08 AM
sorry pxeboot i forgot, you have to do a remaster for you server.
Title: Re: How to enable telnet in pxebooted core?
Post by: gerald_clark on September 04, 2012, 07:57:00 AM
I see no reason for a remaster.
http://wiki.tinycorelinux.net/wiki:netbooting

In 4.6, ab has been renamed tce-ab.
You can always use tce-load.
Title: Re: How to enable telnet in pxebooted core?
Post by: tinypoodle on September 04, 2012, 06:48:35 PM
On a sidenote, you might look into using dropbear instead of sshd for a lighter footprint.
Title: Re: How to enable telnet in pxebooted core?
Post by: caminati on September 07, 2012, 08:19:03 AM
@lid: If you want a quick&dirty way to setup a login server, you can download
http://landley.net/aboriginal/downloads/binaries/extras/

then chmod +x it and sudo ./busybox-i486 telnetd.

This will save the work on inetd and ssh encryption, which is a nuisance in some situations.

     [EDIT]: Edited URL due to a possible forum policy violation. Rich
Title: Re: How to enable telnet in pxebooted core?
Post by: lid on September 07, 2012, 09:17:41 PM
@lid: If you want a quick&dirty way to setup a login server, you can download
http://landley.net/aboriginal/downloads/binaries/extras/

then chmod +x it and sudo ./busybox-i486 telnetd.

This will save the work on inetd and ssh encryption, which is a nuisance in some situations.

Nice, this works for me too. Is this a new busybox version that the one comes with microcore?

[EDIT]: Edited URL due to a possible forum policy violation. Rich
Title: Re: How to enable telnet in pxebooted core?
Post by: lid on September 07, 2012, 09:27:36 PM
I see no reason for a remaster.
http://wiki.tinycorelinux.net/wiki:netbooting

In 4.6, ab has been renamed tce-ab.
You can always use tce-load.

I like the way suggested in the above link to package the tcz extensions as a separate CPIO archive and booted it together with the native initrd in the microcore (see: http://wiki.tinycorelinux.net/wiki:netbooting#putting_it_all_together_another_way).

But my question really is how to locate all dependencies and put them together to create such a CPIO archive. For example openssh.tcz has the following dependencies:

openssl-0.9.8.tcz and gcc_libs.tcz.

And they in turn might depend on others so on so forth.

Do I need to manually put the openssl and gcc_libs plus others together with openssh in the archive? Or I only need to take care of openssh and let the dependencies be taken care magically at boot time?

David

Title: Re: How to enable telnet in pxebooted core?
Post by: Rich on September 07, 2012, 09:50:25 PM
Hi caminati
The way I read the forum rules, you may not post direct links to binaries. I've modified your link to point to
the directory instead.
Title: Re: How to enable telnet in pxebooted core?
Post by: gerald_clark on September 07, 2012, 09:59:31 PM
Use an NFS tce directory and you can use Apps to install extensions and set them to onboot.
Title: Re: How to enable telnet in pxebooted core?
Post by: curaga on September 08, 2012, 12:43:56 AM
Or view the .tree files, which contain all dependencies.
Title: Re: How to enable telnet in pxebooted core?
Post by: tinypoodle on September 08, 2012, 02:49:21 PM
Or see scripting subforum for a script to download extensions with dependencies.
Title: Re: How to enable telnet in pxebooted core?
Post by: genec on September 10, 2012, 06:25:16 PM
sorry pxeboot i forgot, you have to do a remaster for you server.
I'd personally lean towards a dynamic remaster (see wiki) AND you will likely want to configure passwd appropriately.  There are boot codes for passwd manipulation.  I find dynamic remaster allows me to easily update the core.gz as-is then the requisite extensions without doing a full remaster and allows me to reuse the same files for multiple boot scenarios.
Title: Re: How to enable telnet in pxebooted core?
Post by: lid on September 12, 2012, 08:33:30 AM
Or view the .tree files, which contain all dependencies.

Should I start the telnetd in /opt/bootlocal.sh or /opt/bootsync.sh?

Another question is: Will all the scripts in /opt/ and its subdirs be called by the TCL startup scripts? Put in another way, can I add my own startup scripts in the /opt/ and be called automatically?
Title: Re: How to enable telnet in pxebooted core?
Post by: tinypoodle on September 12, 2012, 08:48:03 AM
You have to add them to /opt/bootlocal.sh or /opt/bootsync.sh
Title: Re: How to enable telnet in pxebooted core?
Post by: Rich on September 12, 2012, 11:30:18 AM
Hi lid
Tinycore will run  bootsync.sh , the last entry in that script calls  bootlocal.sh  which runs in the background
asynchronously.
Title: Re: How to enable telnet in pxebooted core?
Post by: lid on September 17, 2012, 11:11:33 AM
Hi lid
Tinycore will run  bootsync.sh , the last entry in that script calls  bootlocal.sh  which runs in the background
asynchronously.

Rich,

This worked fine. I unpacked the core.gz and added my scripts in bootlocal.sh, packed it back to core.gz and pxebooted with the new script.

My next goal is to figure how to compile my own C code and run it on TC. Maybe this is a separate thread.


David
Title: Re: How to enable telnet in pxebooted core?
Post by: Rich on September 17, 2012, 11:30:50 AM
Hi lid
Install compiletc.tcz if you want to compile code. Questions related to that should be in separate thread.