Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: ZyXEL modem CLI questions  (Read 1727 times)

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
ZyXEL modem CLI questions
« on: November 25, 2018, 04:19:41 AM »

I have a couple of general questions about the ZyXEL VMG 1312-B10A modem’s CLI.

1. Logging in as ‘supervisor’ vs ‘admin’? Does it matter which? If so, when does it matter?

2. What’s the deal with "xtm && sh" ? A trick to get to a proper shell, BusyBox ?

3. Wikipedia says that BusyBox uses the ‘Almquist shell’ and that it is like the Bourne shell. What should I watch out for if writing a script for it, as I am getting to reliant on bashisms, features that might only be available in real bash?
« Last Edit: November 25, 2018, 04:38:11 AM by Weaver »
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: ZyXEL modem CLI questions
« Reply #1 on: November 25, 2018, 03:49:48 PM »

In the order of your questions --
  • Logging in as "supervisor" gives you equivalence to "root" powers and all that implies. "Supervisor" is permitted to use the "sh" command to transition from a ZyXEL shell (prompt " > ") to the native Busybox shell (prompt "# ").
  • The "xtm && sh" trick is a way for an unprivileged user (say "admin" or "user") to gain access to the native Busybox shell.
  • One must remember that Wikipedia does not provide absolute, 100% correct, information but is a "best effort" to be correct. The Busybox shell is - er, the Busybox shell! Please see the information, below.
I log into my ZyXEL VMG1312-B10A as "supervisor" and am given access via a ZyXEL shell (prompt " > "). I then obtain access to the root directory of the file system and the Busybox shell by issuing a "sh" command. Finally I request four long listings . . .

[bcat ~]$ ssh supervisor@AP
supervisor@ap's password:
 > sh
~ # ls -l
drwxr-xr-x    2 supervis root             0 Nov 23  2017 bin
drwxr-xr-x    5 supervis root             0 Jan  1  1970 data
drwxrwxr-x    5 supervis root             0 Nov 23  2017 dev
drwxrwxr-x   11 supervis root             0 Nov 23  2017 etc
drwxr-xr-x    2 supervis root             0 Jan  1  1970 home
drwxrwxr-x    6 supervis root             0 Nov 23  2017 lib
lrwxrwxrwx    1 supervis root            11 Nov 23  2017 linuxrc -> bin/busybox
drwxr-xr-x    2 supervis root             0 Nov  3 22:46 log
drwxr-xr-x    2 supervis root             0 Jan  1  1970 mnt
drwxrwxr-x    5 supervis root             0 Nov 23  2017 opt
dr-xr-xr-x   87 supervis root             0 Jan  1  1970 proc
drwxrwxr-x    2 supervis root             0 Nov 23  2017 sbin
drwxr-xr-x   11 supervis root             0 Jan  1  1970 sys
lrwxrwxrwx    1 supervis root             8 Nov 23  2017 tmp -> /var/tmp
drwxrwxr-x    4 supervis root             0 Nov 23  2017 usr
drwxr-xr-x   17 supervis root             0 Nov 25 15:03 var
-rw-rw-r--    1 supervis root       1405653 Nov 23  2017 vmlinux.lz
drwxrwxr-x    4 supervis root             0 Nov 23  2017 webs
~ # ls -l /bin/ash
lrwxrwxrwx    1 supervis root             7 Nov 23  2017 /bin/ash -> busybox
~ # ls -l /bin/bash
lrwxrwxrwx    1 supervis root             7 Nov 23  2017 /bin/bash -> busybox
~ # ls -l /bin/sh
lrwxrwxrwx    1 supervis root             7 Nov 23  2017 /bin/sh -> busybox
~ #  > Connection to AP closed.
[bcat ~]$


So we can see that there are three shells available, ash, bash and sh, by virtue of symbolic links to the Busybox binary. Caution should be observed when attempting to use those shells, for they are not "full and complete" but are basic, limited, versions . . . sufficient for administering to the VMG1312-B10A, nothing more, nothing less.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.