Showing posts with label Remote access. Show all posts
Showing posts with label Remote access. Show all posts

Wednesday, May 2, 2018

Accessing remote GUI application using PuTTY

Extending the post in here, today we will see how the remote GUI applicaiton can be accessed using X server and the PuTTY.

Remote Server configuration:
  •     Ubuntu 16.04
  •     OpenSSH-server
Client machine configuration:
  •     Windows 8 or later
  •     Xming software tool

Remote server setup:
Install openssh-server package by executing following command:
sudo apt-get install openssh-server

Client machine setup:
  • Download Xming for Windows 8 64bit.
  • Install Xming executable file. You don't have to do any changes. Leave everything to the default selection.
  • Download and install the latest verion of the PuTTY from here.

  • Run Xming from the start menu or Issue the following command in command prompt
cd "c:\Program Files (x86)\Xming"
Xming.exe -multiwindow 
  •  Run PuTTY
  • In the PuTTY configuration window enter the IP address, port and select SSH radio button.

  • Select SSH from Connection category.
  • Check "Enable X11 forwarding" option and click on Open button. 


  • In the consol, now enter "gnome-calculator" to verify the above steps.
    Instead of  "gnome-calculator", you can enter command to access remote GUI application.
    I assume that, you know how to open your application from command line/ terminal.


Thats all for now.  


-Thanks


Saturday, June 10, 2017

X11 forwarding using Xming X server for Windows

Problem statement:

Let's say, We have 2 two computers: One with Ubuntu OS and other with Windows OS
Through SSH connection, "How can we access the any application's interface (GUI) installed on Ubuntu computer from Windows computer ?". For example, we want to access the GUI of calculator application that is installed on Ubuntu from Windows computer.

Environment:

First computer:
                       OS- Ubuntu 14.04 64-bit
                       Openssh-server package
Second computer:
                       OS- Windows 8 64bit
                        Xming software tool

Here, for demonstration, we will open GUI of calculator application
The command to open the calculator in Ubuntu is gnome-calculator                      

Step-1:
On Ubuntu Computer, install openssh-server package.

Perform Step-2 to 5 on Windows computer.
Step-2:
On Windows computer: 
Download Xming for Windows 8 64bit.
Install Xming executable file. You don't have to do any changes. Leave everything to the default selection.

Step-3: 
Now open command prompt on Windows computer
Change the directory to the location where Xming is installed. In my case it is "C:\Program Files (x86)\Xming"


cd "c:\Program Files (x86)\Xming"

Step-4:
Now enter the following command to start Xming on Windows


Xming.exe -multiwindow -clipboard


Step-5:
Now its the time to connect to the Ubuntu computer through inbuilt putty. In this step, you need to provide the login information, and the command to open required application.

The command can be

plink -ssh -2 -X user1@<IP of ubuntu computer> -P <port number of SSH server> <command to open the required application>



e.g.

plink -ssh -2 -X chinmaya@120.162.56.85  -P 23 gnome-calculator


Here, I am connecting to the Ubuntu computer through ssh protocol 2.
The IP address and SSH port number of Ubuntu computer is 120.162.56.85 and 23, respectively.
gnome-calculator is the command to open the GUI of calculator application.

After entering the above command, you need to give the corresponding password. If all goes well, the required GUI will appear on Wondows computer.

Please comment if you need more information or if you have any suggestion.

-Thank you



Tuesday, June 21, 2016

Configure openssh-server in ubuntu.

ssh enables one computer to communicate to another computer over a secure encrypted channel. In order to establish the environment we need both ssh server on the target computer and ssh client on the computer from where we intend to access the target computer.

In this post, we'll see how to install ssh-server on the target computer (server)



Requirement:
     OS on target computer : Ubuntu 14.04 or later
     Target computer must be connected to internet to get the required software packages.

Installation:


        1. open the terminal by pressing

 ctrl + Alt + t  


        2. Now enter the following command to install ssh-server

sudo apt-get install openssh-server

              Use sudo for if you are not in root, else you can avoid using

Configuring openssh-server:

        1. Configuration file : To configure, we need to modify sshd_config file present inside /etc/ssh/

        2. Backup : Before configuring, please take a backup of the configuration by entering following command in the terminal

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup

        3. Open configuration file by entering following command.
sudo nano /etc/ssh/sshd_config 
             
        4.  Configure ssh port number. Find the line
 port 22  
             now change the port number according to your requirement.
        5.  Deny root login: Find the line
 PermitRootLogin without-password  

             Now change the line to
 PermitRootLogin no  

        6.  Allow specific user : At the end of the file add following line.

 AllowUsers user1 user2  

             this will restrict all other users with username other then user1 and user2

Above are the basic configuration to start playing with ssh.
Don't forget to restart the ssh service after every modification. To restart the ssh server, use following command
sudo service ssh restart
   
For more information, just comment below.


-Thank you

Friday, June 17, 2016

Accessing Linux (Ubuntu) account remotely through SSH

Its easy to access your linux account exactly sitting in-front of the personal computer. But how about accessing your linux account from another place which is far from the personal computer. Follow below steps to access your linux account.
Definition
Target Computer: the computer to which you want to connect or we can say your personal computer. <refer figure 1>
Source Computer: The computer from which you want to access your target computer. <refer figure 1>
Figure 1: Accessing target Computer from Source computer



Requirement:
    1. Target computer must be turned ON

    2. Target computer must have internet connection
        or
        Source computer must be accessible from target computer through LAN, WAN or in anyway.

    3. Software requirement for Source Computer :
        Putty: which can be downloaded from below link
        For windows: http://tartarus.org/~simon/putty-snapshots/x86/putty.exe
        For Mac & Ubuntu : Use “Terminal” . // No third party software is required
       
    4. Software requirement for Target Computer :
        openssh-server : openssh-server must be install on your personal computer to accept the connection from another computer present remotely

Steps: 

For Target Computer
  1. We assume that Ubuntu is installed on target computer
  2. Install openssh-server by executing below command in the “Terminal”
sudo apt-get install openssh-server
      3. follow below link to configure the openssh-server
               http://blogchinmaya.blogspot.com/2016/06/configure-openssh-server-in-ubuntu.html

For Source Computer

For Windows

    S1: download and install Putty for windows from below link.
    S2: Open putty
Figure 2: Putty in Windows


    S3: Here, it needs 2 main information.
         S3.1: Enter the address of the target computer
         S3.2: Enter the ssh port number on target computer
    S4: Select "SSH" radion option
    S5: now click on "Open" button to connect to the target computer
Figure 3: Putty Login window 
     S6: Now enter your username and password

For Mac & Linux (ubuntu)

    S1: open Terminal (FOR MAC)
         S1.1 : press <command> + <Space> 
         S1.2 : search for “terminal”

Figure 4: Open terminal in mac
    S1: Open Terminal (for Ubuntu)
         You can open the trminal by pressing < ctrl > + < alt > + < t > 

    S2: gather following information
           S2.1: Account name and password in target computer
           S2.2: address of the target address
           S2.3: port, on which ssh server is running on the target computer
    S3: enter following command in terminal
ssh <username>@<address> -p <port number>
           Now enter your password
e.g.


Thats all, its done. Now you can browse the your filesystem using common linux command.