Username: Password:

Author Topic: The Complete Beginners Guide to Setting up Your Linux VPS and Running Gunbot  (Read 47901 times)

Offline hnk

  • Rookie
  • *
  • Posts: 4
    • View Profile
Hey all,
    This is a guide on how to setup your first Linux VPS and get Gunbot running on it. I spent over four hours trying to get all setup and running on my first Linux VPS. I wanted to create a guide that would help others avoid that issue. This guide will follow every. single. step. of me setting up a demo Ubuntu 16.04 AWS VPS on my Mac. The vast majority of the steps should be the same for Windows using PuTTY.

PM me if you have questions or issues and I'd be happy to help.

What this guide will do:
* Get you from having no Linux VPS to up and running with Gunbot
* Give you the most Windows-like experience I’ve been able to create
* Show you how to set up a desktop GUI
* Include all steps needed to get it running
* Provide step-by-step instructions to on how to get your Linux VPS's Gunbot instances looking like this:


What this guide will not do:
* Use only the console. I like having a GUI to quickly monitor my bots
* Install complicated software for viewing Gunbot sessions
* Have missing steps or leave things up to interpretation


Table of Contents:
1. Backstory
2. Picking a VPS provider
2.1. Security!!
3. Accessing your VPS for the first time
4. Setting up VNC so you have a GUI
5. Connecting to VNC and Installing Gunbot
6. Getting Gunbot Running
7. Easy start script and window tiling
8. FAQ

And then a picture of the final result!

1. Backstory

Some quick backstory about me before we get started. I’ve been a Windows guy for most of my life, never really used Linux outside of live-booting some distributions to mess around. I’ve noticed a lot of the guides here seem way more technical, or better for people who are already familiar with Linux.

My goal for this guide was to create a step-by-step walkthrough for setting up a Linux VPS with no prior knowledge and then setting up and running Gunbot.

2. Picking a VPS (Virtual Private Server) provider

There are a lot of VPS providers out there, so picking one can be confusing. A decent Linux VPS with 2 cores, 2gb of RAM, will run around $10-$15 per month. Windows VPSs can cost $5 to $15 more (because of licensing fees), which is why many people opt for using Linux. It may seem like a lot, but you will more than make up for it with the money you make from running Gunbot 24/7.

If this is your first time on Linux, I would recommend starting with the free-tier of AWS and getting familiar with the steps before shelling out cash for a better VPS.

Some common VPS providers: (no referral links)
Turnkey Internet
Vultr
Digital Ocean
Amazon Web Services - Free 1gb/1core VPS for 1 year.
Contabo (Purchased in Euros)

Be sure to look for coupons before locking in a provider. There can be some coupons found that give recurring % discounts. TurnkeyInternet has one at the time of this writing.

For this guide, we’ll be using an AWS (Amazon Web Services) free-tier VPS. My actual VPS are running Gunbot and I don’t want to have to reset everything. The steps are less-complicated for other non-AWS VPS providers, AWS has a lot of additional complexities.

Once you pick the provider and the plan, the next step is to sign up. For the purposes of this guide, pick Ubuntu 16.04 as the Linux distribution for your new VPS.

Be sure to document any passwords you use, or are given.


2.1. Password Security Disclaimer!

Remember to pick a strong password, especially for SSHing in. Your computer's IP will be broadcast to the entire internet. There are people out there who run scripts to scan ranges of IPs and look for open ports. Once they find an open port (like your SSH port 22), they can attempt to brute force your password, change it, and take control of your VPS. This is very rare and can be reset with your VPS provider, but still not good.

Based on what I've read, strongest passwords are over 21 characters of random uppercase letters, lowercase letters, numbers, and symbols. I don't believe SSH passwords can use symbols (I could be wrong). Use a password manager or generator to create random passwords to use. Passwords with words and sentences are much easier to crack than random ones.


After the VPS is spun up, you should get an email (or a page) with some information including the username, password, and server's IP address. You will need these to connect.

2.5 Extra steps for AWS. Most other providers will setup your VPS with a “Root Password” or “Service Password” instead of the keyfile AWS uses.

1. After setting up your AWS account, go to your EC2 dashboard and click “Instances” in the navigation bar on the left.
=

2. Change your region to “N. California”


3. Click "Launch Instance"


4. Select "Ubuntu Server 16.04"


5. Click "Review and Launch" then "Launch" to get the server booted up.

6. Download the keypair (.pem) file. You need this to log in!


7. Click "Launch Instances" to create your VPS.

8. You will be taken to a page with a message saying "Your instance is being created" with a link to view it. Click that link.


9. You can now see your new AWS VPS instance!




Lastly, we'll need to change the security group to allow all traffic, not just SSH. This is so we can connect to it without using only the command line. AWS is the only VPS provider I've seen that restricts traffic automatically.

1. Select your instance, and under Description, click the security group for your instance. In this example, it is "launch-wizard-8"


2. Scroll down, click "Inbound Rules"


3. Click "Edit"

4. Change the type from "SSH" to "All traffic" in the dropdown and click "Save"



Now we can finally access the server!


3. Accessing your VPS for the first time

Once you purchase a VPS, you’ll be given a bunch of information about the new server. As mentioned above, be sure to save all IPs, usernames, and passwords.

Now we want to connect to our new instance. If using AWS, click the "Instances" link in the navigation bar on the left. Other VPS service providers have a management/services/details area where you can go to get the same information.

To connect to your instance:

1. Select your new instance and click "Connect"


2. Amazon provides a nice string that you can just paste in to the terminal (Mac). PuTTY is a little more complex, but thankfully it's much easier with non-AWS VPS providers. This is unique to each instance, mine won't work.

3. For MAC users, open up the terminal (Command + Space, type in Terminal)


4. Next, you need to change the directory to wherever you saved your .pem file. I'm lazy and left it in my downloads folder. To do this, type the following command:
Code: [Select]
cd /users/Rupert/downloads since Rupert is the name of my account on this PC.

5. Change the permissions of your keyfile by typing "chmod 400 pem_filename.pem" into the terminal
Code: [Select]
chmod 400 pem_filename.pem
6. Copy and paste that nice string AWS provided you (the whole thing) and hit enter. For example, mine is:
Code: [Select]
ssh -i "Gunty_Linux_Guide.pem" ubuntu@ec2-54-153-120-203.us-west-1.compute.amazonaws.com
7. You will be prompted to trust the host, type "yes".

8. You should be in! You'll know because your console should change from your computer name/user to something like
Code: [Select]
ubuntu@ip-172-31-1-48:~$

All codes in one window:


Non-AWS users: Connect using the instructions given by the VPS provider. As an example for Mac, the only command I need to access my main VPS is
Code: [Select]
ssh username@ip

More information on accessing your VPS with AWS: AWS Connection Guide


4. Initial Setup (Including VNC so you have a GUI)

The next step is to get VNC and a desktop installed so we can access everything the way we're used to. Without this step, you'd need to do everything through the terminal like we have been. I don't know about you, but that's not something I'm interested in.

First thing's first, you'll need to make sure your VPS is up-to-date.

Run the following commands to get your new VPS totally up-to-date:
Code: [Select]
sudo apt update
Code: [Select]
sudo apt upgrade (Enter Y when prompted)

You may be asked about updating menu.lst. Choose "install the package maintainer's version", but it shouldn't matter too much.


After you've done that, it's time to install a desktop and TightVNCServer. To do that, enter:
Code: [Select]
sudo apt install xfce4 xfce4-goodies tightvncserver (Again, enter Y when prompted)
This will take a minute or two to complete.

After that completes, time to install a few more quality-of-life programs
Install the following programs. Some VPSs may come with them already installed.

Code: [Select]
sudo apt install nano firefox x-tile htop

Once that's complete, it's time to setup a vncserver
Type in the command
Code: [Select]
vncserverYou will be asked to enter a password. Enter an eight character password, then re-enter it.

Save this password. This is how you will get into your machine's desktop. We will need it in the next section.

I usually use random letters and numbers. I will use "testpass" as my very insecure password for this tutorial. I strongly recommend you use an 8 character password with random uppercase letters, lowercase letters, and numbers.

It will then ask you if you want to enter a view-only password. I usually say no.

You now have a VNC server running. Now kill it, we need to edit the config file. Type:
Code: [Select]
vncserver -kill :1
Time to edit the vncserver config!
First, we're going to backup the xstartup file for vncserver. That way we always have something to fall back on in case we mess up.
Code: [Select]
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
Now, we'll remake xstartup to run with the xfce4 desktop we installed earlier:
Enter the following line to open up the nano text editor
Code: [Select]
nano ~/.vnc/xstartupNote: It will say it's a new file since we renamed the old one. That's fine.

Enter the following in the new xstartup file:
Code: [Select]
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

This tells the VNC Server to launch the xfce4 desktop when we connect to the computer.

Press control + o (followed by enter) to save, and control + x to exit out of nano text editor.

Next, we need to make our new file executable. To do this, type:
Code: [Select]
sudo chmod +x ~/.vnc/xstartup

Finally start vncserver again by entering:
Code: [Select]
vncserver -localhost :1
This will open the port only to your local machine, the open port won't be visible to the internet as a whole. This will protect you from having those bad men (and women) I talked about in Section 2.1 from trying to log into your VPS via VNC. VNC has some built-in protections for this, but you'll basically need to restart the machine in order to get back in the action. It's safest to use this method.




You will need to repeat this step every time you restart your machine, which hopefully won't be too often

Whewh. After all that, you should have VNC up and running on this machine. We're close to being able to access the desktop, just a few more steps.

Now, let's install some Gunbot pre-requisites!
First, use curl to get the most up-to-date version of node.js. Shout out to J-Rod for this code.
Code: [Select]
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -curl should be installed, if it's not, type
Code: [Select]
sudo apt install curl and rerun the above command.

To install nodejs, run:
Code: [Select]
sudo apt install nodejs
To make sure the version is correct, enter
Code: [Select]
nodejs --version At the time of writing, my version is 7.10.0.

That's it! Now we're ready to hop in to the GUI and we can leave the commandline behind (for the most part)

5. Connecting to VNC and Installing Gunbot
Get ready for primetime! Now we should be able to connect to our VPS using VNC, get a desktop on a Linux machine much similar to RDP on Windows, and start running Gunbot.

The last thing before connecting to your VPS is getting a VNC viewer
Personally, I use RealVNC Viewer, a free piece of software available on almost every OS there is. It can be downloaded from their website.

Once you've installed RealVNC Viewer, open it up and let's connect to our new server!

1. To connect, we'll need to know the Public IPv4 address and the password we setup vncserver with earlier.

As you can see from the picture on, the Public IPv4 address is on the AWS Instance details page. All other VPS providers should have the IP on the server's information page as well. This is what you used to SSH in the sections above. Mine is: 54.153.120.203



2. Mirroring the local :5901 port to your desktop computer

We want to connect to our VNC server session on the Linux VPS at port 5901. The reason for this is vncserver starts at:1 by default with new instances. VNC's default ports start at 5901 and go up from there. That's what the ":1" signifies when we started our server in the last section.

Output from earlier:
Code: [Select]
ubuntu@ip-172-31-1-48:~$ vncserver -localhost :1
New 'X' desktop is ip-172-31-1-48:1

If you remember, using -localhost means it's only running locally on the VPS. How can we connect to it?

Connecting from a Mac is pretty easy! It's very similar to connecting to the machine through SSH (like we've been doing up until this point). You'll need to start a new terminal session and

Code: [Select]
ssh -L 5901:localhost:5901 root@54.153.120.203
Type in your SSH password (not your VNC password), hit enter. Once you're logged in you're ready to move on to the next step!

Unfortunately, it's a little more complicated to do this on a Windows machine with PuTTY. Thankfully, there are some good guides for SSH Tunneling into VNC using PuTTY. One of them can be found here.

For more information on why this is required, check out this article on StackExchange.


3. Now, open VNC Viewer and start plugging in the information.

Image: This shows me using a less-secure method that I don't recommend, but hopefully the visuals help. Up top is my VNC Viewer, and the address I'm trying to access. Below is the port info from when I ran vncserver in the SSH session.



We want to open up VNC Viewer and enter the localhost:5901. For this test server, that would be
Code: [Select]
localhost:5901After that's entered, press enter.

You may have a message pop-up telling you that the connection is unencrypted. That is fine, click continue. Make sure you always access this machine from a safe location, or people could watch what you do on your VPS.



4. It will now ask you to enter a password. Enter the password you set earlier. The one I set is "testpass", so that's what I'll use. You can have it remember your password if you don't want to do this again.



5. You should now be connected to your VPSs desktop!


6. In the first popup, select "Use Default Config"

7. Click on the Browser icon (the globe with a cursor over it) and Firefox should open. You now have a working Linux VPS with a desktop!


In the next section, we'll go over how to get Gunbot up and running, one of the easiest parts of this whole ordeal.


6. Getting Gunbot Running
Disclaimer: I'm a dinosaur and still using Gunbot v2.0.4, so that's what these steps will address. I'll add 3.2 when I move over in the next few weeks, but the setup steps should be largely the same.

Setting up Gunbot Version 3.2:
1. Download the package from GitHub, along with any patches that were published afterwards.

2. Save the GUNBOT_v3.2_GUI_edition_all_CPU.zip to your computer. This version currently has no patches. If there are at a future date, download those as well.

3. Click on the downloads button, and select "Open Containing Folder" for the file (picture for 2.0.4 version, but steps are the same)


4. Right-click on the .zip and choose "Open with Xarchiver" (picture for 2.0.4 version, but steps are the same)


5. Click the "Extract Files" button

6. In the menu that pops up, click "Extract" as well (picture for 2.0.4 version, but steps are the same)


7. Now you should have an extracted "GUNBOT_v3.2_GUI_edition_all_CPU" folder (picture for 2.0.4 version, but steps are the same)


8. Only if there are patches: Extract the patch .zip and copy the files over to the GUNBOT_v3.2_GUI_edition_all_CPU folder. Replace any conflicting files. That's it!

9.


Setting up Gunbot Version 2.04:

1. Download the package from GitHub.

2. Save the gunbotv2.0.4_linux_x86_x64.zip to your computer.

3. Click on the downloads button, and select "Open Containing Folder" for the file


4. Right-click on the .zip and choose "Open with Xarchiver"


5. Click the "Extract Files" button

6. In the menu that pops up, click "Extract" as well


7. Now you should have an extracted "gunbotv2.0.4_linux_x86_x64" folder


8. Now it's time to open up our good old friend, the terminal. Click the terminal icon in the dock at the bottom.


9. Copy the path of the folder you extracted gunbot to by highlighting the address bar. In the terminal, cd to that directory.
In this example, that's:
Code: [Select]
cd /home/ubuntu/Downloads/gunbotv2.0.4_linux_x86_x64/

10. Next, we need to make the gunbot file executable. Do this by typing
Code: [Select]
chmod +x gunbot[/size]
All commands in terminal:


We're almost ready to start the pairs!

One last step before running your first test pair in Linux:
Update the BTC_Dash-config.js file with your API keys.

1. Right click on BTC_DASH-config.js and select "Open with Mousepad"


2. Paste in your API Key and API Secret in the two spots where it asks for it.


3. Save and close


Run it!
In the terminal (the same window as before) type:
Code: [Select]
./gunbot BTC_DASH
This is what you should see for the result:


Now that you've run it, you're all setup and ready to rock.

Next, create config files for every pair you want to run Gunbot on

Hooray! If you've followed the directions up until this point, you should be up and running with Gunbot. But that's only starting one pair. What if you want to do it faster? We'll tackle that in the next section.


6. Easy start-all-pairs script and window tiling

I've seen a lot of guides on how to view multiple gunbot sessions in Linux. They have all been, in my opinion, too complicated. I just want a bunch of windows open so I can watch my pairs go, I don't want to have to use new control keys to switch between windows. Here is my solution to that (much like running Gunbot headless in Windows)

First off, we'll need to write a script to run everything (or just copy mine)

1. In your terminal that should still be in the gunbot directory, type:
Code: [Select]
nano start_all_pairs.sh
2. Paste in the following text, changing the pair names to the pairs you want to run. Leave everything else the same, unless you want to play with the sleep timers. This will open up htop (a resource watcher), all of your pairs in separate windows, and x-tile (a program to tile all your windows to fit on a single screen).

These pairs are not suggestions, they are simply the top 5 pairs by volume on Poloniex at the time of writing. You can copy these lines for as many pairs as you want to start.

Version 3.2:
Code: [Select]
xfce4-terminal --title="Usage" -e htop
sleep 6
xfce4-terminal --title="BTC_ETH" -e "./gunthy-linuxx64 BTC_ETH poloniex"
sleep 6
xfce4-terminal --title="BTC_XRP" -e "./gunthy-linuxx64 BTC_XRP poloniex"
sleep 6
xfce4-terminal --title="BTC_LTC" -e "./gunthy-linuxx64 BTC_LTC poloniex"
sleep 6
xfce4-terminal --title="BTC_STR" -e "./gunthy-linuxx64 BTC_STR poloniex"
sleep 6
xfce4-terminal --title="BTC_EXP" -e "./gunthy-linuxx64 BTC_EXP poloniex"
sleep 6
x-tile


Version 2.0.4:
Code: [Select]
xfce4-terminal --title="Usage" -e htop
sleep 14
xfce4-terminal --title="BTC_ETH" -e "./gunbot BTC_ETH"
sleep 14
xfce4-terminal --title="BTC_XRP" -e "./gunbot BTC_XRP"
sleep 14
xfce4-terminal --title="BTC_LTC" -e "./gunbot BTC_LTC"
sleep 14
xfce4-terminal --title="BTC_STR" -e "./gunbot BTC_STR"
sleep 14
xfce4-terminal --title="BTC_EXP" -e "./gunbot BTC_EXP"
sleep 14
x-tile

This is what you should see:


3. Press control + o, then enter to save, and control + x to exit.


Assuming start_all_pairs.sh has all the pairs you want, it's time to run it!

1. Using the same terminal as you have been, type:
Code: [Select]
sh start_all_pairs.sh
It should slowly start each of your pairs once ever 14 seconds.


After everything's up and running, it's time to get organized

Now you should have a bunch of disorganized gunbot windows up all over the place. This is where x-tile comes in, and it was the last thing your script ran. There should be a new box up that you haven't seen before, this is x-tile.


1. Select all of the windows you want tiled. I do all of my Gunbot windows only, I don't tile htop, for example. I want that to stay big.



2. Click the "Grid Details" button (to the left of the #1 button with a yellow star) and select the layout you want. I'm running 20 pairs, so I'm going to have 4 rows and 5 columns.



The final result!



And there you have it, gunbot running on Linux, and you can watch all the pairs do their thing and monitor them for any issues.


FAQ

1. What does it mean if I get a grey screen if I try to connect with my VNC Viewer?

This means your ~/.vnc/xstartup file wasn't configured correctly. That file that tells VNC to launch up xfce4 (we installed this in Step 3) desktop when you first connect. If that's not setup right, VNC doesn't know what desktop to startup/view and you get a gray screen.

Head up to the middle of Step 4 to review what file should look like. If for some reason that doesn't fix it, check to make sure xfce4 is installed.


2. When I try to use my AWS .pem key to access the VPS, I get a "Permission Denied" error. What's wrong?

You need to chmod 400 on your .pem key in order to get access. That's in Section 3, step 5.

To fix this, cd to whatever directory the .pem key is saved in and type:

cd to the directory your .pem is saved in and:

Code: [Select]
chmod 400 pem_filename.pem

3. How do I know which IP address to use?

Your VPS provider should've emailed you the IP address of your new server once it's all up and running. Be aware that this might change if/when you restart your machine; AWS is one provider that does this. The new IP can be found on the machine's management page when you're logged in to your VPS provider's website.



Let me know if you have any questions!

Tips!
If you appreciate my work and would like to tip me, you can send coins to the following addresses. You are under no obligation to tip me, but they are appreciated.

BTC: 1MWejnvK2EWzsNViMi9PGYXaNT7HxzTzna
ETH: 0x50e9d068d4567d9d2f890ccc869996cf93201000
LTC: LhG2HPXVoPvaJHkxNSbFfLVGHqYXYH78JV
DASH: XxwVg988TF7dEv6pnfG7weLMatWxukE7CT
ETC: 0xb5a5132414a364391615874aa3ffdc3a74596b14



Thanks to:
Gunthar
J-Rod
Anon 509
Digital Ocean (Great VPS guide found here after much searching)
« Last Edit: May 31, 2017, 05:56:26 AM by hnk »

Offline opedroadami

  • Rookie
  • *
  • Posts: 39
    • View Profile
Thank you for this awesome and easy-to-follow guide!

Unfortunately I had a problem when trying to connect through RealVNC. I could only see a gray pixelated screen and an X for a mouse cursor.

Is it a problem that could easily be fixed?

And can I copy my .json files from my Windows VPS to the Linux VPS instance?

Again, thank you for this awesome contribution to the community.

Offline TopPlayer

  • Rookie
  • *
  • Posts: 2
    • View Profile
Hi, I am using OS X and I get a error trying to set the amazon VPS...

This is the error:

Permission denied (publickey).

When I am in this step: 4. Next, you need to change the directory to wherever you saved your .pem file. I'm lazy and left it in my downloads folder. To do this, type the following command:

Could you help me? thank you !

Offline hnk

  • Rookie
  • *
  • Posts: 4
    • View Profile
Thank you for this awesome and easy-to-follow guide!

Unfortunately I had a problem when trying to connect through RealVNC. I could only see a gray pixelated screen and an X for a mouse cursor.

Is it a problem that could easily be fixed?

And can I copy my .json files from my Windows VPS to the Linux VPS instance?

Again, thank you for this awesome contribution to the community.

Snap, I thought I turned on email notifications but I guess not. You can always message me directly on Telegram and I'll respond within an hour or so.

I was getting the same error earlier too (the very first time), I believe it has something to do with the  ~/.vnc/xstartup file not being configured correctly. That's the file that tells it to open up xfce4 desktop. If that's not setup right you get a gray screen. Hop up to that section of the guide and hopefully, that will fix it.

If that doesn't fix it, check to make sure xfce4 is installed.

Glad you liked the guide! Let me know if that doesn't fix it.

Offline hnk

  • Rookie
  • *
  • Posts: 4
    • View Profile
Hi, I am using OS X and I get a error trying to set the amazon VPS...

This is the error:

Permission denied (publickey).

When I am in this step: 4. Next, you need to change the directory to wherever you saved your .pem file. I'm lazy and left it in my downloads folder. To do this, type the following command:

Could you help me? thank you !

Yup, that sounds like the error you get when you don't chmod 400 on your .pem key. That's in Section 3, step 5. I'll make that clearer, I didn't put that section in a code box for whatever reason, making it easy to miss.

To fix this, cd to whatever directory the .pem key is saved in and type:

Code: [Select]
chmod 400 pem_filename.pem
Let me know if you have any questions!
« Last Edit: May 23, 2017, 01:11:39 AM by hnk »

Offline soyab0007

  • Rookie
  • *
  • Posts: 28
  • 10% discount with code "SOYAB" on GUNBOT License
    • View Profile
    • Tradingbotpro
Excellent tutorial...


Authorized GunBot Reseller

Offline P0s31d0n

  • Rookie
  • *
  • Posts: 4
    • View Profile
Awesome tutorial man thanks a lot for sharing.

Question.

What is the command to stop a Pair?

Also will a pair Stop if you close it's console Window?


Offline lordrocco

  • Rookie
  • *
  • Posts: 2
    • View Profile
I can get to the point where I launch the script and it starts opening Gunbot windows.

After the 4th window, every subsequent window stays open for a second and then closes by itself. It allows no more than four Gunbot windows to stay open.

What in the world is that all about? Any ideas?

Offline dcb942

  • Rookie
  • *
  • Posts: 16
    • View Profile
I am attempting to switch from windows to linux and I get this error:


root@ubuntu-4gb-nyc3-01:~/Downloads# ./gunthy2 bittrex-BTC_AMP
Bot crashed at 2017/06/19 11:41:05
Reason: Failed to load config!!!
Parameter: undefined-bittrex-BTC_AMP-config.js
Original error: { Error: Cannot find module '/root/Downloads/undefined-bittrex-BTC_AMP-config.js'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (evalmachine.<anonymous>:0:0)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at Module.require (evalmachine.<anonymous>:0:0)
    at require (internal/module.js:20:19)
    at loadConfig (evalmachine.<anonymous>:0:0)
    at new Bot (evalmachine.<anonymous>:0:0)
    at Object.console./snapshot/Users/Enrico/Desktop/xBot_v2.9.3/index.js.dev (evalmachine.<anonymous>:0:0)
    at Module._compile (evalmachine.<anonymous>:0:0)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (evalmachine.<anonymous>:0:0)
    at run (bootstrap_node.js:426:7)
    at startup (bootstrap_node.js:147:9)

Any ideas? I have double checked spelling etc.

Offline theswede

  • Rookie
  • *
  • Posts: 5
    • View Profile
First of all, huge respect for putting this guide together. Awesome work, a tip is coming as soon as I get this up and running!

So actually I'm pretty stuck at step 5.2 which says:

Quote
Type in your SSH password (not your VNC password), hit enter. Once you're logged in you're ready to move on to the next step!

Until now I haven't been prompted to set an SSH password yet. And after entering the command
Code: [Select]
ssh -L 5901:localhost:5901 root@54.153.120.203

I only get a Permission denied (publickey) error without anywhere or any chance to enter a password.

I've checked the permissions on the .perm file, they are OK.

What am I doing wrong or not seeing? Thanks in advance for the help! :)
« Last Edit: June 21, 2017, 08:04:54 PM by theswede »

Offline krixt

  • Rookie
  • *
  • Posts: 38
    • View Profile
Why in the world are you using XWindows? That overcomplicates things 1,000%. Just use normal SSH and do everything you just did on command line. You don't have to mess with realVnc, you don't have to open your server to everyone on the internet. (All ports, all IP addresses, wide open to anyone with a computer. You're practically asking to be hacked. And the fact that you're ignoring encrypted VNC makes this even worse.)

You are already doing everything on commandline anyway, you're just adding the additional, completely unnecessary, step of doing terminal commands through a GUI.

This is by no means an efficient process. There are several other tutorials on this forum for starting up multiple bots within screen or tmux sessions, and only using SSH.

This should not be a pinned article.
« Last Edit: July 07, 2017, 12:48:41 AM by krixt »

Offline krixt

  • Rookie
  • *
  • Posts: 38
    • View Profile
At the very least, please obscure the IP address of your VPS.
Also, show the people here how to restrict the Security Group to their own IP address and not make it wide open to the world.
Finally, if you must do the VNC (completely unnecessary) instead of allowing all ports, just allow 22 (SSH) and 5900-5905 (VNC) and it will still work fine and you won't have painted a target on your back.

Offline krixt

  • Rookie
  • *
  • Posts: 38
    • View Profile
This is what the security group should look like people. Please be smart. Once you choose "My IP" it will auto populate your current IP address into the box that I've blacked out. It should be XX.XX.XX.XX/32

Offline Spythe

  • Rookie
  • *
  • Posts: 19
    • View Profile
I was wondering if I'd kill the VNC process (to free up RAM), do the terminal sessions from the GUI still remain active or is it like killing the VPS?

Offline Antaeus

  • Rookie
  • *
  • Posts: 2
    • View Profile
First of all, huge respect for putting this guide together. Awesome work, a tip is coming as soon as I get this up and running!

So actually I'm pretty stuck at step 5.2 which says:

Quote
Type in your SSH password (not your VNC password), hit enter. Once you're logged in you're ready to move on to the next step!

Until now I haven't been prompted to set an SSH password yet. And after entering the command
Code: [Select]
ssh -L 5901:localhost:5901 root@54.153.120.203

I only get a Permission denied (publickey) error without anywhere or any chance to enter a password.

I've checked the permissions on the .perm file, they are OK.

What am I doing wrong or not seeing? Thanks in advance for the help! :)

I am getting the exact same error! any help? - Additionally, I do not have the permission to access the desktop through VNC Viewer - it says that the computer has refused the connection, I have only put the IPv4 and a name for the connection and left everything else default. (I have done the process step by step 2 times, and still get the same error.

At first glance I thought probably since i hadnt set a root/ssh password, the authentication would take place with a public key and the passwd wouldn be disabled.. but after running "root@ip-172-31-4-175:~/.ssh# ssh -v localhost" this is what i found:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:CXhRwooeVUze/I/hDL+HfXVHr+zW/dpkI9PqYCwr5i8
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

Any ideas on how to solve the problem?
« Last Edit: August 27, 2017, 08:19:13 AM by Antaeus »

Offline Storx

  • Rookie
  • *
  • Posts: 2
    • View Profile
Does anyone know why the colors and scale of the VPS login on VNC Viewer is so terrible? looks terrible and nearly unreadable

Offline klemens

  • Rookie
  • *
  • Posts: 1
    • View Profile
Re: The Complete Beginners Guide to Setting up Your Linux VPS and Running Gunbot
« Reply #16 on: September 19, 2017, 08:48:31 AM »
Thanks for easy to understand guide.

I successfully managed almost all the steps even if Im not a tech savy.

My Gunbot just closes down after I hit start.

Please see in video https://www.useloom.com/share/312dfa1d135e4f7b980ab4655ec1785b

Please advise, what should I do?

Offline sagesmooth

  • Rookie
  • *
  • Posts: 3
    • View Profile
I fI accidentally put the ip address of the OP post how do I cancel that?

Here's what my terminal says
"ssh -L 5901:localhost:5901 root@54.153.120.203
The authenticity of host '54.153.120.203 (54.153.120.203)' can't be established.
ECDSA key fingerprint is SHA256:TP/soxOshGRtpbmNtuo+jiRpBUMGBBqj1yiKfNJ3x8w.
Are you sure you want to continue connecting (yes/no)? y 
Please type 'yes' or 'no': yes
Warning: Permanently added '54.153.120.203' (ECDSA) to the list of known hosts.
Permission denied (publicly)."

Never used linux before so I'm hoping for some easy help.

Thanks!

Offline n30n_p3ngu1n

  • Rookie
  • *
  • Posts: 3
    • View Profile
Can I safely use AWS inbound security rules to whitelist multiple IP's, or do I need to do that with my vnc config somehow?

Edit: seems to work fine whitelisting IP's from AWS. Anyone see any danger in that?

Another question: How do I change the resolution of my ubuntu?
« Last Edit: October 12, 2017, 01:52:56 AM by n30n_p3ngu1n »