Ubuntu – How to run script (.sh) files in a new terminal after connecting to Ubuntu 16.04 server via ssh

bashcommand linescriptsserverssh

I tried many ways such as

terminator -x abc.sh
The above command gives me this error:

You need to run terminator in an X environment. Make sure $DISPLAY is properly set

I also tried

gnome-terminal -x ./abc.sh

The above command gives me the error below

Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Failed to parse arguments: Cannot open display:

Best Answer

Assuming Ubuntu to Ubuntu

If you use Windows 10 desktop and want to connect to your ubuntu server

A simple solution is to install and use Putty in Windows according to the following link,

www.putty.org/

PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.

You can download PuTTY here.

You can start one or more Putty windows and run different tasks via ssh.


As described in a comment by @SergiyKolodyazhnyy, you can use xrdp to open remote desktop session from Windows to Ubuntu.

As described in a comment by @PerlDuck, you can install and use an X server in Windows to be able to run graphical application programs via ssh, but according to your original question, it might be overkill.

Related Question