LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-23-2022, 10:13 AM   #1
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Rep: Reputation: Disabled
VPS setup help wanted


I am trying to set up a VPS to act as tunnel with GUI browser. I think this first code is correct, it seems to work.
Code:
# start with what is available, rebuild:
Linux Debian 8.2 X86 64 Minimal Gen2 V1

# adjust local system and log into vps:
bullseye@debian:~$ ssh-keygen -f "/home/bullseye/.ssh/known_hosts" -R "105.170.52.193"
# /home/bullseye/.ssh/known_hosts updated.
bullseye@debian:~$ ssh root@105.170.52.193
# The authenticity of host '105.170.52.193 (105.170.52.193)' can't be established. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
# root@105.170.52.193's password: 
password: originalrootpassword

# add normal user:
root@vaa:~# adduser usernormal
Enter new UNIX password: usernormalpassword
press ENTER for the default
	Full Name []: 
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n]

# change root password:
root@vaa:~# passwd
Enter new UNIX password: newrootpassword
# passwd: password updated successfully

update, upgrade, shutdown
root@vaa:~# apt-get update
root@vaa:~# apt-get upgrade
root@vaa:~# shutdown -r
# client_loop: send disconnect: Broken pipe
bullseye@debian:~$
Next I login and did this, I try to get GUI.
Code:
tasksel
Debian desktop environment 
GNOME
SSH server 
# 1195 files. 10 minutes. 15%.
But now no GUI when I log in. Maybe I should have done this instead?
Code:
apt-get install task-gnome-desktop
sudo apt-get install gnome
Or this?
Code:
startx
I would like advice before I start experimenting. Later, after GUI works, I suspect I will get connect and resolving errors in terminal. If so
Code:
 add nameserver 8.8.4.4 to /etc/resolv.conf
And later I will need firewall. Please help.
 
Old 04-24-2022, 03:10 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Just to clarify, VPS is a virtual private server you rented somewhere remotely?

And how are you trying to log into the GUI? Via ssh? Then you'll need -X. PLease read 'man ssh'. It probably still won't work, but your ssh session won't magically transform into a GUI when you run startx inside it.

Maybe you need to reboot again after installing the GUI.

Also the usual warning: Don't allow root login over ssh.

And my personal opinion: a GUI on a server is a bad idea.
 
Old 04-24-2022, 08:22 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Quote:
Originally Posted by b1bb2 View Post
I am trying to set up a VPS to act as tunnel with GUI browser.
Can you rephrase that or clarify in more detail what you are trying to do?

I'll second the points made already, especially the last point. It's not appropriate for a server to have a graphical interface.

If you are trying to browse the web and use the VPS as an exit point, there are several ways to do that with minimal fuss and no server-side graphics. For that you can use SSH for dynamic port forwarding (see the -D option) or set up a full VPN using StrongSwan, WireGuard, OpenVPN, or OpenSSH.
 
1 members found this post helpful.
Old 04-25-2022, 12:35 AM   #4
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
It seems that my VPS was working like I need it to, before I started this topic. VPS GUI and internet access work well when I access it through my host noVNC Console. Now there are some improvments to try. When I login using ssh, command prompt appears, How can I get GUI? And I am not experienced with firewall, can someone help with this? My intended use for VPS is like the product https://www.onworks.net/runos/prepar...8.0-i386-DVD-1, for my own personal use. Google complained that my clock was set to march 30, 2013. Did this date come from my OS?

To ondoho, LQ Addict: Just to clarify, VPS is a virtual private server I rented somewhere remotely. I am trying to log into the GUI Via ssh. ssh -X Connection timed out.

To Turbocapitalist, LQ Guru: Sorry I am not clear. I would be more clear if I understood this. I am not familiar with the programs you listed, but they sound nice. For now I will keep what I have, it works.
 
Old 04-25-2022, 01:24 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by b1bb2 View Post
It seems that my VPS was working like I need it to, before I started this topic. VPS GUI and internet access work well when I access it through my host noVNC Console. Now there are some improvments to try. When I login using ssh, command prompt appears, How can I get GUI? And I am not experienced with firewall, can someone help with this? My intended use for VPS is like the product https://www.onworks.net/runos/prepar...8.0-i386-DVD-1, for my own personal use. Google complained that my clock was set to march 30, 2013. Did this date come from my OS?

To ondoho, LQ Addict: Just to clarify, VPS is a virtual private server I rented somewhere remotely. I am trying to log into the GUI Via ssh. ssh -X Connection timed out.

To Turbocapitalist, LQ Guru: Sorry I am not clear. I would be more clear if I understood this. I am not familiar with the programs you listed, but they sound nice. For now I will keep what I have, it works.
You need to read documentation - try man pages for ssh, ssh_config, sshd, sshd_config.
X forwarding is probably disabled or restricted server side. You might need to edit /etc/ssh/sshd_config, and restart the daemon.
 
Old 04-25-2022, 04:18 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Quote:
Originally Posted by ondoho View Post
You need to read documentation - try man pages for ssh, ssh_config, sshd, sshd_config.
X forwarding is probably disabled or restricted server side. You might need to edit /etc/ssh/sshd_config, and restart the daemon.
For X11 forwarding, it is "just" a matter of installing the application on the VPS, say xeyes or Firefox, and then connecting with the -X option for the SSH client.

However, the new versions of Ubuntu might be using Wayland by default and that would complicate things significantly.
 
Old 04-25-2022, 03:10 PM   #7
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
OK. On my PC client, which has new version of debian, I read man pages for ssh, ssh_config. I read /etc/ssh/ssh_config. The term X forwarding is not in any of them. Is there another term I should search for?
VPS host has an old version of debian. Ubuntu is not used. Firefox is already installed and running on VPS.

GOOD:
man ssh
man ssh_config
gedit /etc/ssh/ssh_config

BAD:
No manual entry for sshd
No manual entry for sshd_config
ls: cannot access '/etc/ssh/sshd_config': No such file or directory
ls: cannot access '/etc/ssh/ssh_config.d/*.conf': No such file or directory
 
Old 04-25-2022, 10:58 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Turbocapitalist View Post
For X11 forwarding, it is "just" a matter of installing the application on the VPS, say xeyes or Firefox, and then connecting with the -X option for the SSH client.
Even if X forwarding is disabled on the server?

Quote:
Originally Posted by b1bb2 View Post
OK. On my PC client, which has new version of debian, I read man pages for ssh, ssh_config. I read /etc/ssh/ssh_config. The term X forwarding is not in any of them. Is there another term I should search for?
Yes, the -X option. And it's X11 forwarding in ssh's man page.

Quote:
BAD:
No manual entry for sshd
No manual entry for sshd_config
Apparently you do not have the ssh daemon installed on the client.
You need to check these on the server.
 
Old 04-26-2022, 12:06 PM   #9
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Here is my /etc/ssh/ssh_config file on my PC client. What should I change?
Code:
# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Include /etc/ssh/ssh_config.d/*.conf

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
#   UserKnownHostsFile ~/.ssh/known_hosts.d/%k
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
I guess I should change
Code:
#   ForwardX11 no
into
Code:
    ForwardX11 yes
?

On my PC client, synaptic package manager says the package x11-session-utils is installed. I can not find a debian package named sshd. What package should I install? On which system?

I guess I should set DISPLAY environment variable, how to do?
How do I restart the daemon? What is the service name? Is this code correct?
Code:
sudo systemctl restart <ServiceName>
DISPLAY=set
echo $DISPLAY
 
Old 04-26-2022, 10:16 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by b1bb2 View Post
Here is my /etc/ssh/ssh_config file on my PC client. What should I change?
First of all:
Code:
See ssh_config(5) for more information.
That's 'man 5 ssh_config' or just 'man ssh_config'.

Quote:
Originally Posted by b1bb2 View Post
I guess I should change
Code:
#   ForwardX11 no
into
Code:
    ForwardX11 yes
?
yes.

Quote:
On my PC client, synaptic package manager says the package x11-session-utils is installed. I can not find a debian package named sshd. What package should I install? On which system?
Not sure what those x11-session-utils are about. Why do you think you need it?*
On my distro, both client and server are installed by the package openssh.
On Debian it is openssh-client (ssh) and openssh-server (sshd) respectively.

Quote:
I guess I should set DISPLAY environment variable, how to do?
You shouldn't need to do this manually. Why do you think so?*
Quote:
How do I restart the daemon? What is the service name? Is this code correct?[code]
sudo systemctl restart <ServiceName>
Yes. It's sshd.service. On the server.

* sounds like you're halfway through some tutorial and expect us to figure out which, and how far you got.
 
Old 04-27-2022, 04:55 PM   #11
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Here are answers to your questions.
First of all: I saw ssh_config(5) for more information. I mentioned that in post#7. I am asking you to help me understand and impliment it.

I think I need the package x11-session-utils because it is installed (I do not know when or why. But if it was installed, I probably needed it.) And ssh_config talks about x11.

I thought I should set DISPLAY environment variable because it is mentioned in man pages for ssh, ssh_config. But after re-reading them, I see this is done automatically. So now I will not do it manually.

I'm not halfway through some tutorial. And I do not expect you to figure out which, and how far I got.
However, I did find one that seems to echo what you have said.
Code:
# https://www.configserverfirewall.com/debian-linux/
# Install SSH Server Debian Linux - Openssh Server Debian 8.3
# First update the apt source list using apt-get update command.
apt-get update

# Then install the openssh server on debian using apt-get install command.
apt-get install openssh-server

# Now start and enable the debian ssh server to start at system reboot.
systemctl start ssh.service
systemctl enable ssh.service

# Also run netstat command to make sure that ssh port 22 is open and running.
netstat -tulnp | grep 22

# You can view the status of the ssh server using systemctl command.
systemctl status ssh.service
Here is what I did.
These code works, I ran them seporately on my PC client.
Code:
man ssh_config 5
sudo apt-get install -y openssh-client openssh-server
sudo chmod a+rwx /etc/ssh/ssh_config
gedit /etc/ssh/ssh_config
man sshd
man sshd_config
ls /etc/ssh/sshd_config
I manually replaced "# ForwardX11 no" with " ForwardX11 yes" in /etc/ssh/ssh_config.

I ran this code as root on my VPS server. sudo is not installed yet.
Code:
apt-get install -y openssh-server
# openssh-server is already the newest version.
systemctl restart sshd.service
What now?
I would like GUI to appear when I login to VPS using ssh, instead of having to use noVNC Console. Can this be done? The /etc/ssh/ssh_config file on my PC client was edited. Should I edit the /etc/ssh/ssh_config file on my VPS also? It says Tunnel no. Should I change this?
 
Old 04-27-2022, 07:25 PM   #12
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Have you tried using the -X option when you login?
Code:
ssh -X username@remotepornbrowser
Then you can start a GUI app and have it show-up on your local system by starting it from the command line on the server.
 
Old 04-27-2022, 08:47 PM   #13
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
That was mentioned in post 2 and 8. I tried it but forgot to say so. I also tried it just now, after the changes and when you said so. Tested with root and normal user. Still no GUI.

Code:
bullseye@debian:~$ ssh -X usernormal@105.170.52.193
usernormal@105.170.52.193's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
usernormal@vaa:~$
Code:
bullseye@debian:~$ ssh -X root@105.170.52.193
root@105.170.52.193's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@vaa:~#
 
Old 04-27-2022, 09:19 PM   #14
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I think there is a disconnect between what we think you want and want you really want.
Logging in with ssh -X will not give you a GUI desktop, it just enables you to run a GUI app from the server but displaying on your local system. If you ran firefox from your server command line it should display on your local system.

If you want a full desktop to login to, then you need to install a desktop of your choice then something like VNC to interact with it.
 
Old 04-28-2022, 01:01 AM   #15
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
Thank you uteck, that answer is helpful. Post #4 and the link in it best describe what I really want, I agree the wording is hard to understand. Desktop was installed in post #1.
Code:
ssh -X usernormal@107.175.50.195
firefox
does just what you said, it displays on my local system.
Mouse does not work on remote system. Now I need to be careful and install the software package that works on the installed operating system, and onto the correct hardware. Is vnc4server compatable with remmina and or x11vnc? Here are some steps I figured out but not tested. Can someone please comment before I run them?
Code:
# VPS remote server debian 8 jessie as root:
apt-get install vnc4server

# VPS remote server debian 8 jessie as normal user:
vnc4passwd 
Password: 6 – 8 characters
Verify:
vncserver :1
vnc4server -geometry 800x600 -depth 24
vncserver :1 -geometry 800x600 -depth 24

# PC local client debian 11 bullseye as normal user:
sudo apt-get install remmina x11vnc

Last edited by b1bb2; 04-28-2022 at 01:03 AM. Reason: fix code block
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VPS wanted b1bb2 Linux - Server 1 02-25-2022 06:35 PM
How to redirect all traffic from a VPS to another VPS 124748768 Linux - Networking 0 07-08-2011 10:36 AM
2 vps vs 1 vps bmayhem Ubuntu 0 05-04-2009 03:08 PM
I'm looking to upgrade to a vps but wanted to know if a reseller program would work? SEOTRICKS General 0 02-17-2009 09:37 PM
Where can I download UML VPS or Xen VPS to make a virtual private server? abefroman Linux - Software 3 12-09-2005 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration