Use SSH to securely manage your device, either directly, or Out-Of-Band via a terminal server to a serial console.
Securely connect to your device and execute shell commands on the device, do this directly to the device, or via a network connected terminal server to the serial port on the device.
Typical device that you would use SSH for are: