Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

How to Access Linux Desktop from Windows?

By using Virtual Network Computing (VNC) , you can display or access the Linux desktop from any Network or Internet. Linux Desktop can be accessed by another Linux
System or Windows System which is on a network or internet. Here letus focus on
Steps to be followed for accessing Linux Desktop from Windows System
We have to establish a VNC connection to a desktop environment (such as KDE or GNOME) on the Linux system

Step 1. Ensure VNC server is installed and running on the Linux system whose desktop you want to access. ( from windows system)
Step 2. Ensure VNC viewer client installed on the system on which you want to display your Linux desktop. (TightVNC)
Step 3. Secure shell (ssh) connection may be established between the Linus & Windows system.

How to Get VNC Server and Client ?
Recent releases of Linux such as Redhat Linux and Fedora Core come with vncserver which is installed automatically. You can also use TightVNC which can be downloaded for free from http://www.tightvnc.com/download.html

Detail of Step 1 :
------------------
How to Start & Stop the the VNC Server in Linux system.
To start the VNC Server , run the command vncserver
when you run the command first time , it will ask password. give password. then You will get the following message if you are a root user:

New 'vkj:3 (root)' desktop is vkj:3

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/vkj:3.log
where vkj is the hostname of the linux machine.
To change the password use the command vncpasswd

The above statement indicates that vncserver has started up an X server as display :3 on system "vkj" and that it has created a sub-directory called .vnc in the /root
directory that started the server containing a startup script xstartup. In addition it creates a log file that can be used to diagnose any problems when the server failed to start.

To stop the VNC server , run the following command:

vncserver -kill :3

where the :3 matches the display that was indicated when vncsever started up. This will display something along the lines of:

Killing Xvnc process ID 9523

Configuring the Desktop Environment to be Launched by VNC. When we start the vncserver it runs the script xstartup which is located in the folder .vnc under /root or /home/username/.vnc for other than root user.

#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

To launch the GNOME desktop environment change the twm line in xstartup to:
gnome-session &
Similarly to launch the KDE desptop environment change the line to:
startkde &

Detail of Step 2 :
------------------
Installing the VNC Viewer Client
---------------------------------
Next step is to install the client side VNC viewer on Windows machine. (vncviewer incase of linux) . TightVNC can be used which can be downloaded from
http://www.tightvnc.com/download.html

Detail of Step 3 :
-----------------
Establishing a SSH between the two systems :
Due to security reasons, it is recommended that the VNC communication take place through an encrypted secure tunnel connection. SSH can be used On Linux for secure remote connection. On Windows we can use PuTTY which is freely downloaded from http://www.putty.nl/download.html

By default the VNC server will use the port 59xx for communication where xx represents the display number. If vncserver is running as display :1 then the port being used is 5901. If it running as display :3 then port 5903 is used. Suppose if the VNC is using the port 5903 on a system called "vkj" then can establish an ssh connection as follows:

Windows using PuTTY:
--------------------
1. Start PuTTY, enter the hostname or IP address of the system running VNC server. In our example this is "192.168.79.128" ip address of vkj

2. Set the "SSH" toggle.

3. Select the SSH --> Tunnels option from the tree and enter the following information:

Source port: 5903
Destination: 192.168.79.128:5903 , The click on add button.

4. Save the profile you have entered by selecting "Session" from the Tree, entering name (in our example kk) in the "Saved Sessions" text field and press "Save"

5. Press the "Open" button to establish the secure connection.

You will be prompted for a password for the user under which you are logging in.





( Note : incase of Linux system use the command : ssh -L 5903:localhost:5903 vkj)

Launching the VNC Viewer Client
On Window using TightVNC simply launch the TightVNC viewer and enter localhost:3 into the Connection details dialog and press "OK".

( in case of Linux or UNIX , ou have to give the command : vncviewer localhost:3)
Now You will be prompted for a password. This is the password of vncserver.


Read more...

How to make SSH Connection from Windows to Linux ?

Making secure connections between Linux to Linux is very easy by using the inbulit command (SSH) . eg. $ssh root@192.168.79.128 where 192.168.79.128 is the IP address of the destination linux system.

For making Secure Shell(SSH) connections between Windows to Linux , we can use the free utility Putty which is freely availabe from http://www.putty.nl/download.html . Now let us see how to use putty. Run the putty.exe , a window will open as follows.


The following steps should be followed.
1) Give Hostname or IP Address of the Linux Machine in the Hostname textbox .
2) Select the option SSH which will display the port 22 ( SSH will use the port 22)
3) You can save this session for future access by giving the name in the text box of the saved sessions.
4) Click on the Open button which will ask the username and password.

Now the connection between windows & linux is secured.
Read more...

Start / Stop Services in Windows & Linux

Windows

1) Windows Services can be started by net start
Windows Services can be stoped by net stop
Full list of the services can be found in the registry under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services . Registry can be opened by running Run->regedit
eg. net start DB2-0 ---> starting db2 service.

2) You can also start/stop by using Run->services.msc which will open the following window. You can select any services and start & stop by manualy.


Linux

1) service service name stop or start or restart or status
to stop/start/restart the service of httpd use the following commands.
service httpd stop
service httpd start
service httpd restart
service httpd status

2) All scripts for start/stop/restart of all services are are located in /etc/init.d directory . List of scripts of services can be seen by $ls /etc/init.d
so you can just go there and type the script name and either stop or start or restart

or /etc/init.d/ status or stop or start or restart

eg. /etc/init.d/httpd status ->to check httpd status.
/etc/init.d/httpd stop -> to stop httpd service.
/etc/init.d/httpd restart -> to restart httpd service.

To stop httpd service at startup you can use the chkconfig command:

chkconfig --levels 3 httpd off
Read more...

 
Copyright 2011 Java Online