Linux Remote Access

in #tutorial5 years ago (edited)

Introduction

How to remotely access a linux machine.

Create a Persistent VNC Session on Suse Linux Enterprise Server:

  1. Open a shell and make sure you are logged in as the user that should own the VNC session.
  2. If the network interface serving the VNC sessions is protected by a firewall, you need to manually open the port used by your session in the firewall. If starting multiple sessions you may alternatively open a range of ports.
    vncserver uses the ports 5901 for display :1, 5902 for display :2, and so on. For persistent sessions, the VNC display and the X display usually have the same number.
  3. To start a session with a resolution of 1024x769 pixel and with a color depth of 16-bit, enter the following command:
    vncserver -geometry 1024x768 -depth 16
    The vncserver command picks an unused display number when none is given and prints out its choice. See man 1 vncserver for more options.

When running vncviewer for the first time, it asks for a password for full access to the session. If needed, you can also provide a password for view-only access to the session.

The password(s) you are providing here are also used for future sessions started by the same user. They can be changed with the vncpasswd command.


IMPORTANT: Security Considerations

Make sure to use strong passwords of significant length (eight or more characters). Do not share these passwords.

VNC connections are unencrypted, so people who can sniff the network(s) between the two machines can read the password when it gets transferred at the beginning of a session.


To terminate the session shut down the desktop environment that runs inside the VNC session from the VNC viewer as you would shut it down if it was a regular local X session.

If you prefer to manually terminate a session, open a shell on the VNC server and make sure you are logged in as the user that owns the VNC session you want to terminate. Run the following command to terminate the session that runs on display :1: vncserver -kill :1

Connecting to a Persistent VNC Session:

To connect to a persistent VNC session, a VNC viewer must be installed. The standard viewer on SUSE Linux products is vncviewer, provided by the package tightvnc. You may also view a VNC session using your Web browser and a Java applet.

To start your VNC viewer and connect to display :1 of the VNC server, use the command
vncviewer jupiter.example.com:1

Instead of the VNC display number you can also specify the port number with two colons:
vncviewer jupiter.example.com::5901

Alternatively use a Java-capable Web browser to view the VNC session by entering the following URL: http://jupiter.example.com:5801

Source: https://www.suse.com/documentation/sled11/book_sle_admin/data/cha_vnc.html

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.032
BTC 62432.37
ETH 3003.22
USDT 1.00
SBD 3.78