Author Topic: SSH access to the GXP1610  (Read 5324 times)

exeyesoftware

  • Beta Club Members
  • Sr. Member
  • *
  • Posts: 493
    • View Profile
SSH access to the GXP1610
« on: April 04, 2015, 01:44:11 PM »
I've been doing a bit of poking around, prompted by some useful comments others have made, and have learned a bit about the SSH interface of the phone.  My guess is that a similar interface exists for most Grandstream products.  To the best of my knowledge it is undocumented.

SSH stands for "Secure Shell" and is a command-line interface.  To use it I downloaded PuTTY, which worked with no fussing.

You can log in with your admin user name and password.  You'll get a command prompt of "GXP1610>".  Start by entering "help".  You'll get a version of this:

configEnter the "config" submenu
statusLots of device status like IP addresses and firmware versions
ps_statusProcess listing
phone_statusVery basic phone status
upgradeEnter the "upgrade" submenu
rebootReboot the phone
reset*Warning* - resets phone to factory configuration
format modeFormat user data partition (not tried)
format mode 0Reset user data (not tried)
linkShow link (network) status
helpShow list of available commands
audiotuneAudio tuning tool (not tried)
exitExit shell and drop connection

If you enter the "config" subment you get a lot of potentially useful commands.  After entering the "config" command from the main menu, the prompt changes to "CONFIG>" indicating that you are in the "config" submenu.  Here are the "config" commands:

set name variableSet a P-value (leave out the "P")
set ip dhcpSet WAN to DHCP mode
set ip addressSet WAN IP address
set netmask maskSet WAN network mask
set gw addressSet WAN gateway address
set mac addressSet WAN MAC address
get nameGet a P-value (leave out the "P")
get ipGet WAN IP address
get netmaskGet WAN netmask
get gwGet WAN default gateway
unset nameUnset a P-value (leave out the "P")
commitWrite changes to flash memory
cfg_updateApply changes
helpShow a list of available commands
exitLeave "config" mode

Of particular interest is the "unset" command.  I don't know exactly what it does.  It seems to remove the P-value from the list entirely.

Lastly we have the "upgrade" submenu, indicated by a prompt of "UPGRADE>":

set TFTPSets upgrade mode to TFTP
set HTTPSets upgrade mode to HTTP
set HTTPSSets upgrade mode to HTTPS
set URL serverSet upgrade server URL to "server"
commitWrite any changes made by above commands to flash memory
upgradePerform an upgrade using selected mode
helpShow a list of available commands
exitLeave the "upgrade" submenu

All of this suggests some useful applications.  As others have noted, this gives a way to invoke a firmware upgrade directly (though without the ability to upload a local file).  It also provides a way to read and set P-values, which suggests the possibility of developing alternative ways to provision phones and backup/restore configurations.  Interestingly, this technique seems to allow reading and setting all P-values, including passwords.

Hopefully this will be of some value to someone.  I think I'll save a copy of it for when Grandstream takes down the beta forums.

-jimc

GSSupport74

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
    • Email
Re: SSH access to the GXP1610
« Reply #1 on: April 05, 2015, 07:13:51 PM »
Hi exeyesoftware,

Thank you for your testing and explanations! Yes, SSH is a way to access phone, and users could change the P values, remove the P values, and do firmware upgrading/downgrading,  and users also could check the information from SSH interface. But it is not recommend people to use SSH to do these, it is better to follow the User Guide to use the general way.


Thank you!

vmiro

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SSH access to the GXP1610
« Reply #2 on: May 17, 2017, 05:06:58 AM »
Hi,
on some phones I have limited set of commands:

Supported commands:
    status      -- Show device status
    ps_status   -- Show ps command output
    phone_status   -- Show current phone basic status
    upgrade     -- Upgrade the device
    reboot      -- Reboot the device
    format mode -- Format user data partition
         mode 0 -- Reset user data
    link        -- Show Ethernet link status
    help        -- Show this help text
    bttest      -- Start Bluetooth Test
    exit        -- Exit this command shell

There is no config command, so, I can't configure phone from SSH. What could be a problem?

Thanks

Marcin

  • Hero Member
  • *****
  • Posts: 2858
    • View Profile
    • Email
Re: SSH access to the GXP1610
« Reply #3 on: May 19, 2017, 12:10:14 AM »
Different firmware ?
Life is waste of time

vmiro

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SSH access to the GXP1610
« Reply #4 on: May 19, 2017, 04:26:52 AM »
I did an upgrade to latest version.
The phone is configured with configuration file...can this cause this lock on SSH ?

In phone options I don't see any option to block user interface in SSH. Only restricion (but for keypad) I see is Configuration via Keypad Menu which is set to Unrestricted.

Marcin

  • Hero Member
  • *****
  • Posts: 2858
    • View Profile
    • Email
Re: SSH access to the GXP1610
« Reply #5 on: May 19, 2017, 04:51:59 AM »
You have 16xx phone ?
Life is waste of time

vmiro

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: SSH access to the GXP1610
« Reply #6 on: May 19, 2017, 04:58:55 AM »
Yes, here is the P option in configuration file:

# Configuration Via Keypad Menu. 0 - Unrestricted, 1 - Basic settings only, 2 - Constraint mode. Default is 0
# Number: 0, 1, 2
# Mandatory
P1357 = 0

Marcin

  • Hero Member
  • *****
  • Posts: 2858
    • View Profile
    • Email
Re: SSH access to the GXP1610
« Reply #7 on: May 19, 2017, 05:33:26 AM »
i can see config.
If you have config you can try Factory check on fresh and upload config.
Life is waste of time