Skip to content

Commit

Permalink
Merge pull request #76 from threefoldtech/threefold_guides
Browse files Browse the repository at this point in the history
Threefold guides
  • Loading branch information
Mik-TF committed May 3, 2023
2 parents 6f40696 + 05aa1ca commit 6464453
Show file tree
Hide file tree
Showing 8 changed files with 1,393 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- [Tutorial: Find Node](dashboard/explorer/explorer_find_capacity.md)
- [Tutorial: Deploy Your First VM](weblets/weblets_vm.md)
- [SSH Remote Connection](getstarted/ssh_guide/ssh_guide.md)
- [Remote Desktop and GUI](getstarted/remote-desktop_gui/remote-desktop_gui.md)
- [Cockpit: a Web-based Interface for Servers](getstarted/remote-desktop_gui/cockpit_guide/cockpit_guide.md)
- [XRDP: an Open-Source Remote Desktop Protocol](getstarted/remote-desktop_gui/xrdp_guide/xrdp_guide.md)
- [Apache Guacamole: a Clientless Remote Desktop Gateway](getstarted/remote-desktop_gui/guacamole_guide/guacamole_guide.md)
- [Planetary Network](getstarted/planetarynetwork.md)
- [Terraform](terraform/terraform_readme.md)
- [Installing Terraform](terraform/terraform_install.md)
Expand All @@ -29,6 +33,7 @@
- [Mounts](terraform/advanced/terraform_mounts.md)
- [Capacity planning](terraform/advanced/terraform_capacity_planning.md)
- [Updates](terraform/advanced/terraform_updates.md)
- [Nextcloud Redundant Deployment](terraform/advanced/terraform_nextcloud_redundant.md)
- [Javascript Client](javascript/grid3_javascript_readme.md)
- [Installation](javascript/grid3_javascript_installation.md)
- [Loading client](javascript/grid3_javascript_loadclient.md)
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/dao_voting/dao_voting.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To vote, you need to log into your Threefold Dashboard account, go to the DAO se
You can watch this short video to learn how to vote for a Threefold DAO proposal:

<div class="youtubeVideoWrapper">
<iframe title="Threefold Dashboard DAO Voting" width="560" height="315" src="https://peertube.hostservice.nl/videos/embed/5b6813ea-7efa-4325-a413-082d831bc51e" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups"></iframe>
<iframe title="Threefold Dashboard DAO Voting" width="560" height="315" src="https://www.youtube-nocookie.com/embed/8RvBpmloVV0" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups"></iframe>
</div>

If you have any questions, ask around on the [Threefold forum DAO section](https://forum.threefold.io/c/dao/).
Expand Down
86 changes: 86 additions & 0 deletions src/getstarted/remote-desktop_gui/cockpit_guide/cockpit_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<h1> Deploy a Full VM and Run Cockpit, a Web-based Interface for Servers </h1>

<h2> Table of Contents </h2>

- [Introduction](#introduction)
- [Deploy a Full VM and Create a Root-Access User](#deploy-a-full-vm-and-create-a-root-access-user)
- [Set the VM, Install and Access Cockpit](#set-the-vm-install-and-access-cockpit)
- [Conclusion](#conclusion)

***

## Introduction

In this Threefold Guide, we show how easy it is to deploy a full VM and access Cockpit, a web-based interface to manage servers. For more information on Cockpit, visit this [link](https://cockpit-project.org/).

For more information on deploying a full VM and using SSH remote connection, read [this SSH guide](../../ssh_guide/ssh_guide.md).

If you are new to the Threefold ecosystem and you want to deploy workloads on the Threefold Grid, read the [Get Started section](../../tfgrid3_getstarted.md) of the Threefold Manual.

***

## Deploy a Full VM and Create a Root-Access User

To start, you must [deploy and SSH into a Full VM](../../ssh_guide/ssh_guide.md).

* Go to the [Threefold Playground](https://play.grid.tf/#/)
* Deploy a full VM (e.g. Ubuntu 22.04)
* With an IPv4 Address
* After deployment, copy the IPv4 address
* In the terminal write
* ```
ssh root@VM_IPv4_address
```
* To create a new user with root access
* Here we use `newuser` as an example
* ```
adduser newuser
```
* To see the directory of the `newuser`
* ```
ls /home
```
* Give sudo capacity to the new user
* ```
usermod -aG sudo newuser
```
* Make the new user accessible by SSH
* ```
su - newuser
```
* ```
mkdir ~/.ssh
```
* ```
nano ~/.ssh/authorized_keys
```
* add the authorized public key in the file, then save and quit
* Exit the VM and reconnect with new user
* ```
ssh newuser@VM_IPv4_address
```

***

## Set the VM, Install and Access Cockpit

* Set the system up to date:
* ```
sudo apt update -y && sudo apt upgrade -y && sudo apt-get update -y
```
* Install Cockpit:
* ```
. /etc/os-release && sudo apt install -t ${UBUNTU_CODENAME}-backports cockpit -y
```
* Access Cokcpit on a web browser:
* Write the following URL with the VM IPv4 address:
* ```
VM_IPv4_Address:9090
```
* Enter the username and password of the root-access user

***

## Conclusion

You now have access to a web-based graphical interface to manage your VM. Read [Cockpit's documentation](https://cockpit-project.org/documentation.html) to explore further this interface.
184 changes: 184 additions & 0 deletions src/getstarted/remote-desktop_gui/guacamole_guide/guacamole_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<h1> Deploy a Full VM and Run Apache Guacamole (RDP Connection, Remote Desktop) </h1>

<h2> Table of Contents </h2>

- [Introduction](#introduction)
- [Deploy a Full VM and Create a Root-Access User](#deploy-a-full-vm-and-create-a-root-access-user)
- [SSH with Root-Access User, Install Prerequisites and Apache Guacamole](#ssh-with-root-access-user-install-prerequisites-and-apache-guacamole)
- [Access Apache Guacamole and Create Admin-Access User](#access-apache-guacamole-and-create-admin-access-user)
- [Download the Desktop Environment and Run xrdp](#download-the-desktop-environment-and-run-xrdp)
- [Create an RDP Connection and Access the Server Remotely](#create-an-rdp-connection-and-access-the-server-remotely)
- [Feedback and Questions](#feedback-and-questions)
- [References](#references)

***

## Introduction

In this guide, we deploy a full virtual machine (Ubuntu 20.04) on the Threefold Grid with IPv4. We install and run [Apache Guacamole](https://guacamole.apache.org/) and access the VM with remote desktop connection by using [xrdp](https://www.xrdp.org/).

The Apache Guacamole instance has a two-factor authorization to give further security to the deployment.

With Apache Guacamole, a user can access different deployments and command servers remotely, with desktop access.

This guide can be done on a Windows, MAC, or Linux computer. For more information on deploying a full VM and using SSH remote connection, read this [SSH guide](../../ssh_guide/ssh_guide.md).

If you are new to the Threefold ecosystem and you want to deploy workloads on the Threefold Grid, read the [Get Started section](../../tfgrid3_getstarted.md) of the Threefold Manual.

***

## Deploy a Full VM and Create a Root-Access User

* Go to the [Threefold Playground](https://play.grid.tf/#/)
* Deploy a full VM (Ubuntu 20.04) with at least the minimum specs for a desktop environment
* IPv4 Address
* Minimum vcores: 2vcores
* Minimum Gb of RAM: 4Gb
* Minimum storage: 15Gb
* After deployment, note the VM IPv4 address
* Connect to the VM via SSH
* ```
ssh root@VM_IPv4_address
```
* Once connected, create a new user with root access (for this guide we use "newuser")
* ```
adduser newuser
```
* You should now see the new user directory
* ```
ls /home
```
* Give sudo capacity to the new user
* ```
usermod -aG sudo newuser
```
* Make the new user accessible by SSH
* ```
su - newuser
```
* ```
mkdir ~/.ssh
```
* Add authorized public key in the file and save it
* ```
nano ~/.ssh/authorized_keys
```
* Exit the VM and reconnect with the new user

***

## SSH with Root-Access User, Install Prerequisites and Apache Guacamole

* SSH into the VM
* ```
ssh newuser@VM_IPv4_address
```
* Update and upgrade Ubuntu
* ```
sudo apt update && sudo apt upgrade -y && sudo apt-get install software-properties-common -y
```
* Download and run Apache Guacamole
* ```
wget -O guac-install.sh https://git.io/fxZq5
```
* ```
chmod +x guac-install.sh
```
* ```
sudo ./guac-install.sh
```

***

## Access Apache Guacamole and Create Admin-Access User

* On your local computer, open a browser and write the following URL with the proper IPv4 address
* ```
https://VM_IPv4_address:8080/guacamole
```
* On Guacamole, enter the following for both the username and the password
* ```
guacadmin
```
* Download the [TOTP](https://totp.app/) app on your Android or iOS
* Scan the QR Code
* Enter the code
* Next time you log in
* go to the TOTP app and enter the given code
* Go to the Guacamole Settings
* Users
* Create a new user with all admin privileges
* Log out of the session
* Enter with the new admin user
* Go to Settings
* Users
* Delete the default user
* Apache Guacamole is now installed

***

## Download the Desktop Environment and Run xrdp

* Download a Ubuntu desktop environment on the VM
* ```
sudo apt install tasksel -y && sudo apt install lightdm -y
```
* Choose lightdm
* Run tasksel and choose `ubuntu desktop`
* ```
sudo tasksel
```

* Download and run xrdp
* ```
wget https://c-nergy.be/downloads/xRDP/xrdp-installer-1.4.6.zip
```
* ```
unzip xrdp-installer-1.4.6.zip
```
* ```
bash xrdp-installer-1.4.6.sh
```

***

## Create an RDP Connection and Access the Server Remotely

* Create an RDP connection on Guacamole
* Open Guacamole
* ```
http://VM_IPv4_address:8080/guacamole/
```
* Go to Settings
* Click on Connections
* Click on New Connection
* Write the following parameters
* Name: Choose a name for the connection
* Location: ROOT
* Protocol: RDP
* Network
* Hostname: VM_IPv4_Address
* Port: 3389
* Authentication
* Username: your root-access username (newuser)
* Password: your root-access username password (newuser)
* Security mode: Any
* Ignore server certificate: Yes
* Click Save
* Go to the Apache Guacamole Home menu (top right button)
* Click on the new connection
* The remote desktop access is done

***

## Feedback and Questions

If you have any questions, let us know by writing a post on the [Threefold Forum](https://forum.threefold.io/).

***

## References

Apache Guacamole for Secure Remote Access to your Computers, [https://discussion.scottibyte.com/t/apache-guacamole-for-secure-remote-access-to-your-computers/32](https://discussion.scottibyte.com/t/apache-guacamole-for-secure-remote-access-to-your-computers/32)

MysticRyuujin's guac-install, [https://github.com/MysticRyuujin/guac-install](https://github.com/MysticRyuujin/guac-install)
11 changes: 11 additions & 0 deletions src/getstarted/remote-desktop_gui/remote-desktop_gui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Remote Desktop and GUI

This section of the Threefold Guide provides different methods to access your 3node servers with either a remote desktop protocol or a graphical user interface (GUI).

If you have any questions, or if you would like to see a specific guide on remote desktop connection or GUI, please let us know by writing a post on the [Threefold Forum](http://forum.threefold.io/).

<h2>Table of Contents</h2>

- [Cockpit: a Web-based Graphical Interface for Servers](./cockpit_guide/cockpit_guide.md)
- [XRDP: an Open-Source Remote Desktop Procol](./xrdp_guide/xrdp_guide.md)
- [Apache Guacamole: a Clientless Remote Desktop Gateway.](./guacamole_guide/guacamole_guide.md)
Loading

0 comments on commit 6464453

Please sign in to comment.