Enabling SSH

Since it is a real pain to work in an rdp, or a graphical console on 25×80 characters, first thing we want to have is an ssh session to work with. From the convenient console of our liking, where we can paste and log. This took me some painful hours of guessing the commands from scripts and a lot of trial and error. Enjoy, Let’s get to it.

setcfg LOGIN "SSH Enable" TRUE
/etc/init.d/login.sh start

# if this is not enough, there is one config file that needs editing
vi /etc/default_config/uLinux.conf

# search for this section and change the FALSE to TRUE for sshd Enable
[LOGIN]             
SSH Enable = TRUE 
SSH Port = 22 
TELNET Enable = FALSE
TELNET Port = 13131

What this does, is:

1, create the ssh separation user, group (guest) and it’s directories, which is by the way

[sshd]:x:110:65534:SSHD Privilege Separation:/var/empty:/bin/sh

2, it creates the rsa and dsa key pairs

[~] # ll /etc/config/ssh/
total 24K
drwxr-xr-x  2 admin administrators  200 Jun 29 19:59 ./
drwxr-xr-x 21 admin administrators 2.5K Jun 29 20:00 ../
lrwxrwxrwx  1 admin administrators   16 Jun 29 19:59 id_rsa -> ssh_host_rsa_key
lrwxrwxrwx  1 admin administrators   20 Jun 29 19:59 id_rsa.pub -> ssh_host_rsa_key.pub
-rw-------  1 admin administrators 1.4K Jun 29 19:59 ssh_host_dsa_key
-rw-r--r--  1 admin administrators  605 Jun 29 19:59 ssh_host_dsa_key.pub
-rw-------  1 admin administrators 2.6K Jun 29 19:59 ssh_host_rsa_key
-rw-r--r--  1 admin administrators  569 Jun 29 19:59 ssh_host_rsa_key.pub
-rw-r--r--  1 admin administrators  188 Jun 29 19:59 sshd_config
-rw-r--r--  1 admin administrators   17 Jun 29 19:59 sshd_user_config

Carefully assemble the mdRaid (Raid5 in my case)

A missing disk? We’ll look into that later. For the purpose of data extraction, 3 out of 4 is enough, if you are in a hurry.

[~] # mdadm --examine --scan
ARRAY /dev/md/256  metadata=1.0 UUID=8063634e:7a5599c9:99b40cd2:24878311 name=256
ARRAY /dev/md/322  metadata=1.0 UUID=520848dd:98eff90e:ed5a241f:3bbae5b7 name=322
ARRAY /dev/md/9  metadata=1.0 UUID=35cf0ce4:294f39d0:e02ad1da:e53f776a name=9
ARRAY /dev/md/256  metadata=1.0 UUID=d4ad498a:7da8fb33:6e9f5b0d:001b575b name=256
ARRAY /dev/md/1  metadata=1.0 UUID=2a5370b7:b7218673:3c062ecc:4df3f825 name=1
ARRAY /dev/md/13  metadata=1.0 UUID=76b64c56:edecd52e:9791d137:df3fe4ce name=13
ARRAY /dev/md/322  metadata=1.0 UUID=966bbcc7:ff9e8288:8e982269:8bdffd1f name=322

[~] # mdadm --examine --scan >> /etc/mdadm.conf 

[~] # mdadm --detail /dev/md1 
/dev/md1:
        Version : 1.0
  Creation Time : Mon Sep  7 12:04:35 2020
     Raid Level : raid5
     Array Size : 11691190272 (11149.59 GiB 11971.78 GB)
  Used Dev Size : 3897063424 (3716.53 GiB 3990.59 GB)
   Raid Devices : 4
  Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Wed Jun 29 16:59:31 2022
          State : clean, degraded 
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : 1
           UUID : 2a5370b7:b7218673:3c062ecc:4df3f825
         Events : 57750

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       19        1      active sync   /dev/sdb3
       2       8       67        2      active sync   /dev/sde3
       3       8       35        3      active sync   /dev/sdc3

Initialize LVM

[~] # /etc/init.d/init_lvm.sh help
Changing old config name...
mv: can't rename '/etc/config/ssdcache.conf': No such file or directory
mv: can't rename '/etc/config/qlvm.conf': No such file or directory
mv: can't rename '/etc/config/qdrbd.conf': No such file or directory
Reinitialing...
Detect disk(8, 80)...
ignore non-root enclosure disk(8, 80).
Detect disk(8, 48)...
ignore non-root enclosure disk(8, 48).
Detect disk(8, 16)...
ignore non-root enclosure disk(8, 16).
Detect disk(8, 64)...
ignore non-root enclosure disk(8, 64).
Detect disk(8, 32)...
ignore non-root enclosure disk(8, 32).
Detect disk(8, 0)...
ignore non-root enclosure disk(8, 0).
dev_count = 0
Detect disk(8, 80)...
ignore non-root enclosure disk(8, 80).
Detect disk(8, 48)...
ignore non-root enclosure disk(8, 48).
Detect disk(8, 16)...
ignore non-root enclosure disk(8, 16).
Detect disk(8, 64)...
ignore non-root enclosure disk(8, 64).
Detect disk(8, 32)...
ignore non-root enclosure disk(8, 32).
Detect disk(8, 0)...
ignore non-root enclosure disk(8, 0).
sys_startup_p2:got called count = -1
Done

[~] # pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/md1   vg1  lvm2 a--  10.89t    0 

[~] # vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  vg1    1  57   0 wz--n- 10.89t    0 

[~] # lvs
  LV        VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1       vg1  Vwi---t---   8.00t tp1                                                
  lv1312    vg1  -wi-------   1.11g                                                    
  lv2       vg1  Vwi---t---   2.00t tp1                                                
  lv3       vg1  Vwi---t---   2.00t tp1                                                
  lv4       vg1  Vwi---t---   1.07t tp1                                                
  lv544     vg1  -wi------- 111.49g                                                    
  snap10001 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10002 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10003 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10004 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10005 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10006 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10007 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10008 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10009 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10010 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10011 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10012 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10013 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10014 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10015 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10016 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10017 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10018 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10019 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10020 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10021 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10022 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10023 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10024 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10025 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10026 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10027 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10028 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10029 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10030 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10031 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10032 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10033 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10034 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10035 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10036 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10037 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10038 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10039 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10040 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10041 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10042 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10043 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10044 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10045 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10046 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10047 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10048 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10049 vg1  Vwi---t---   8.00t tp1  lv1                                           
  snap10050 vg1  Vwi---t---   8.00t tp1  lv1                                           
  tp1       vg1  twi---t---  10.71t