Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: Adam on August 01, 2013, 06:08:30 PM
-
April last year, I had experience to configure ssh server (sshd) in Tiny Core Linux and had documented it here.
http://firewallengineer.wordpress.com/2012/04/01/how-to-install-and-configure-openssh-ssh-server-in-tiny-core-linux/
All these were running on live cd.
When I installed TC in hard disk (VDI), I’ve noticed that /usr/local/etc/ssh/sshd_config will be gone every time I reboot my VB guest. Is there any way to make it permanent?
http://firewallengineer.wordpress.com/2013/08/02/how-to-make-ssh-server-configuration-permanent/
-
Add it to /opt/.filetool.lst and do a backup.
-
Add it to /opt/.filetool.lst and do a backup.
Can you share example of /opt/.filetool.lst
This is what I have in my TC
root@box:~# cat /opt/.filetool.lst
opt
home
root@box:~#
Quick ssh server configuration
cd /usr/local/etc/ssh/
cp sshd_config.example sshd_config
/usr/local/etc/init.d/openssh start
Change tc password
passwd tc
To verify
ps | grep ssh
telnet tc@localhost
-
Hi Adam
Add the following to /opt/.filetool.lst
usr/local/etc/ssh/sshd_config
-
Thanks. This is my current config. Good things is file “usr/local/etc/ssh/sshd_config” is remain, but ssh service does not restart automatically.
Hence, I’ve to restart it manually after reboot. Is it possible to make this permanent?
RESTART SSH SERVER MANUALLY
root@box:~# /usr/local/etc/init.d/openssh start
root@box:~# passwd tc
Changing password for tc
New password:
VERIFY SSH SERVICE
root@box:~# ps | grep ssh
814 root /usr/local/sbin/sshd
820 root sshd: tc [priv]
828 tc {sshd} sshd: tc@pts/0
890 root grep ssh
root@box:~#
root@box:~# ls -l /usr/local/etc/ssh/
total 28
lrwxrwxrwx 1 root root 44 Aug 12 07:02 moduli -> /tmp/tcloop/openssh/usr/local/etc/ssh/moduli
lrwxrwxrwx 1 root root 56 Aug 12 07:02 ssh_config.example -> /tmp/tcloop/openssh/usr/local/etc/ssh/ssh_config.example
-rw------- 1 root root 668 Aug 12 07:07 ssh_host_dsa_key
-rw-r--r-- 1 root root 598 Aug 12 07:07 ssh_host_dsa_key.pub
-rw------- 1 root root 227 Aug 12 07:07 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 170 Aug 12 07:07 ssh_host_ecdsa_key.pub
-rw------- 1 root root 1679 Aug 12 07:07 ssh_host_rsa_key
-rw-r--r-- 1 root root 390 Aug 12 07:07 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 3715 Aug 1 02:44 sshd_config
lrwxrwxrwx 1 root root 57 Aug 12 07:02 sshd_config.example -> /tmp/tcloop/openssh/usr/local/etc/ssh/sshd_config.example
root@box:~#
CURRENT CONFIG
root@box:~# ls -l /opt/.filetool.lst
-rw-rw-r-- 1 root staff 39 Aug 12 05:57 /opt/.filetool.lst
root@box:~#
root@box:~# cat /opt/.filetool.lst
opt
home
usr/local/etc/ssh/sshd_config
root@box:~#
BACKUP
root@box:~# filetool.sh -b
Backing up files to /mnt/sda1/tce/mydata.tgzDone.
root@box:~#
AFTER REBOOT
root@box:~# ps | grep ssh
798 root grep ssh
root@box:~#
root@box:/# ls -l /usr/local/etc/ssh/
total 28
lrwxrwxrwx 1 root root 44 Aug 12 06:55 moduli -> /tmp/tcloop/openssh/usr/local/etc/ssh/moduli
lrwxrwxrwx 1 root root 56 Aug 12 06:55 ssh_config.example -> /tmp/tcloop/openssh/usr/local/etc/ssh/ssh_config.example
-rw-r--r-- 1 root root 3715 Aug 1 02:44 sshd_config
lrwxrwxrwx 1 root root 57 Aug 12 06:55 sshd_config.example -> /tmp/tcloop/openssh/usr/local/etc/ssh/sshd_config.example
root@box:/#
-
You need to start it from /opt/bootlocal.sh for example. Also, you forgot to backup the passwd file.
-
You need to start it from /opt/bootlocal.sh for example. Also, you forgot to backup the passwd file.
Done. Works like a charm. Thanks a lot curaga. Now I understand how Core Linux works a little bit especially on the persistent part.
http://wiki.tinycorelinux.net/wiki:start#persistence
http://distro.ibiblio.org/tinycorelinux/concepts.html
EDIT START UP FILE
tc@box:/$ echo '/usr/local/etc/init.d/openssh start &' >> /opt/bootlocal.sh
tc@box:/$
VERIFY
tc@box:/$ cat /opt/bootlocal.sh
#!/bin/sh
# put other system startup commands here
/opt/eth0.sh &
/usr/local/etc/init.d/openssh start &
tc@box:/$
BACKUP
tc@box:/$ filetool.sh -b
Backing up files to /mnt/sda1/tce/mydata.tgzDone.
tc@box:/$