Is there a way to view (and control) a remote desktop through SSH? I will not have physical access to the remote host machine.
Ubuntu – How to set up remote desktop sharing through SSH
opensshsshvncvncviewer
Related Solutions
Use SSH to get to the machine. Ask gnome not to ask, "Are you sure?" after enabling the remote desktop access. Then enable remote access.
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
You could create scripts for this, too, maybe /usr/local/bin/start-remote-desktop.sh.
Use your favorite editor over vim if you like...
sudo vim /usr/local/bin/start-remote-desktop.sh
The contents of that file:
#!/bin/bash
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
Make it executable:
sudo chmod 0755 /usr/local/bin/start-remote-desktop.sh
Add it to your default user configuration:
sudo sh -c 'echo "/usr/local/bin/start-remote-desktop.sh" >> /etc/skel/.profile'
As far as the human factor goes in maintaining 500 workstations, you would love using CloneZilla. The one CloneZilla server provides pre-configured images for the workstations which can be installed over the network. You can even multicast them so that in just a few hours, to guess, all the workstations can be imaged with a common configuration, same version, etc... There's a good tutorial on dedoimedo.com.
The steps you mentioned that you have performed would be specific if you were on the same network or connecting to a remote machine with it's IP exposed with no firewalls.
If the host machine (as in almost all cases) is connected to a router and have a provide IP you would have to perform port forwarding to the computer you want to connect to. The router port to forward is 5900 TCP. You'll also have to ensure you have not blocked port 5900 though the host's firewall. Also ensure to allow connection from the client's IP via /etc/hosts.allow
.
Summary of client's access to the server:
1) Port forwared to the host IP in the routher (tcp 5900) 2) Firewall's port 5900 open 3) Access granted to the client's IP address via /etc/hosts.allow
/etc/hosts.allow:
# /etc/hosts.allow: list of hosts that are allowed to access the system. # See the manual pages hosts_access(5) and hosts_options(5). # # Example: ALL: LOCAL @some_netgroup # ALL: .foobar.edu EXCEPT terminalserver.foobar.edu # # If you're going to protect the portmapper use the name "rpcbind" for the # daemon name. See rpcbind(8) and rpc.mountd(8) for further information. # ALL: [remote desktop client's ip here]
You mentioned Ubuntu's default Desktop Sharing. That is the one I'm addressing. It doesn't use rdp
so you can leave that protocol along. Just concentrate on the VNC capable clients. The Remmina Remote Desktop Client
will work. Just make sure you have it set for VNC and not the other choices.
You have already specified port 22 (ssh
) is working which means that port is forwarded. Now the same way you setup and tested ssh
, you will have to do the same thing with port 5900
, for vnc
.
You have already specified what you need in the Vino configuration which is:
1. Allow other users to view your Desktop (Checkmark) 2. Allow other users to control your Desktop (Checkmark) 3. You must confirm (No Check mark) 4. Require the user to enter password (optional) 5. Automatically configure UpNp router (optional) 6. Show Notification area icon (optional)
Only three settings (highlighted in bold) is required for the connection. The other items are optional.
Just set the above configuration, close and connect with a VNC
enabled client.
While the Remmina
client will work, I used vinagre to test and prepare thses steps.
Best Answer
Method 1 :
This can be achieved with vino vnc server & remmina (both come default with ubuntu; if not install it by running
sudo apt-get install remmina
). Then Run Following commands from local computer in terminal prompt:ssh -Y gman@remote
. Use trusted X11 forwarding, otherwise it wont workvino-preferences
. It will open vino-preferences.Also Click
configure network automatically to accept connection
. But don't enter any password, its base64 encoded. Then click close. Then run:It will start the vino server.
Logout from server:
Then open remmina. Choose
vnc
under protocol.Under
basic
tab put server address inserver
field.On ssh tab click
enable ssh tunnel
. Underssh authentication
, it could bepassword
orpublic key
:Click save. And then double click connection-name(home-desktop as shown in the picture) to start browsing remote desktop.
Method 2:
x11vnc
is a simple VNC server and you won't have to mess around with Gnome settings or 500 firewalls, just installx11vnc
on all your computers (with puppet or whatever you're using for mass-control).Then from your local computer run:
Obviously swapping
user@host
for the username and hostname/IP of the remote computer.And then use a VNC client of your choice to connect to
localhost:5900
. The SSH command starts a vnc server on the remote computer and then tunnels back that port over SSH. You don't have to open up any ports (as long as you can already SSH).If your computers have funny display settings, you might do better to leave off the
-display :0
segment in the SSH command.x11vnc
will then automatically try to find the right display.Source: askubuntu