Counter-Strike Dedicated Server on Debian Squeeze
05-30-2011, 01:02 AM,
#1
Counter-Strike Dedicated Server on Debian Squeeze
[Image: j8h5co.png]
Tutorial: Counter-Strike Dedicated Server on Debian Squeeze.


Preface:
In this tutorial which is based on text and pictures I will teach you all you need in order to get a working Counter-Strike dedicated server on a Debian Squeeze (6.0)/ Lenny (5.0) system. I will provide all tools and codes you will need during this tutorial so you can easily follow me. Before we can start I will clear some things for you so you don't get confused in the Linux world. I'm offering a service within this tutorial. I can setup a server for you with Metamod, AMXMODX and Dproto and plugins of your choice for free.

Explanation:
As stated above I will explain you some things you should know before messing with Linux OSes.

Su or Sudo?
As a part of the system you have to use su on Debian to gain root access with an non-administrative user to install some software we will need during the tutorial. This command is different from OS to OS. On Ubuntu you have to use sudo, if you try to use sudo on Debian you will get this error message: "-bash: sudo: command not found" so you have to use su instead.

Why should I never create a dedicated server as root?
If you create a dedicated server as the root user of your system you open the doors for hackers and they could take over your system when thy hack into the root account. So, please create a new account on your system. On Debian: adduser username (e.g: adduser setestuser). After that use this new account to create the dedicated server(s).

Chmod?
Linux is not Windows!!! If you want execute a application you have downloaded via wget you have to set the premission as a non-administrative user. Normaly chmod u+x should do the thing for hldsupdatetool.bin on every Linux Distro (Debian, Ubuntu, Fedora and so on...). Usage example: chmod u+x hldsupdatetool.bin, chmod u+x run_server and so on.


How do I run a application without being in the system?
For this task you need a application like screen, but we will use tmux as tmux is much better then screen and its really powerful and easy to use. This applications will allow you run the dedicated server without being logged into the system all the time. They will also grant you that you don't kill the dedicated server when you accidently close the SSH session(s).

If you need more explanation feel free to contact me, RichardGv or Unrealized. We'll be glad to help you with Linux and its commands.

Requirements:
This is the last thing before we can start with this tutorial.

  1. A server running on Debian Squeeze or Lenny.
  2. Putty SSH Client (We need this to connect to the machine).
  3. WinSCP (Pretty awesome SFTP/FTP/SCP client).
  4. Server.cfg Creator (We need a good server configuration).

That is all we need, the rest you will get from Debian package servers such as tmux and hldsupdatetool.


Lets start with the tutorial now...

Step One:
Download Putty from above posted link under "Requirements" and start it. You will see the main window. Enter the IP or hostname of your server into the first field and click on the open button at the bottom (See screenshot one).

Screenshot One:
[Image: bgr3w0.png]

At the very first connection to your machine you will get a weird message with a long key. Just accept it and go on to the login screen. Now Putty asks you for a username, just use the one you created via adduser. Then it asks you for the password of this user. Type its password and hit enter and you will be in the system (Don't worry if you see nothing when you type the password) . Look at the following screenhots.

Screenshot Two:
[Image: 5fkcya.png]

Screenshot Three:
[Image: 2lbl3ee.png]

Screenshot Four:
[Image: 15gvuyb.png]

Step Two:
Now we will download the hldsupdatetool and set the premission for it. Type the command "wget http://www.steampowered.com/download/hldsupdatetool.bin into the main screen of putty and hit enter (See screenshot five). After the download is done type chmod u+x hldsupdatetool.bin and we are done with step two (See screenshot six).

Screenshot Five:
[Image: 2vxhel0.png]

Screenshot Six:
[Image: 105zkoh.png]

(Type "ls" and see if hldsupdatetool.bin is green, if not repeat chmod u+x... again)

Step Three:
Now we will execute hldsupdatetool and accept the agreement and finaly download the server content. To run hldsupdatetool.bin type "./hldsupdatetool.bin" after that you will get the agreement. Accept this by typing "yes" and hit enter (See screenshot seven). After that type "./steam -command update -game cstrike -dir cs" and wait until it starts to download. If it does not start repeat this command several times until it does or ask here for advice (See screenshot eight).

Screenshot Seven:
[Image: dpyd7p.png]

Screenshot Eight:
[Image: 15grn61.png]

Now relax and wait until the download has finished (See screenshot nine).

Screenshot Nine:
http://i51.tinypic.com/2cok9zk.png

We are done with step three.

Step Four:
Now we will create a server configuration for our Counter-Strike dedicated server and a launcher which will restart the server on every crash. Go to the site linked on "Requirements": http://www.cstrike-planet.com/cfgmaker?cfg=srcds and build the config you need. After you have build it download WinSCP from "Requirements" and extract, then start it. Use the informations you used with Putty and login into the file server (See screenshot ten) by clicking the login button at the bottom.

Screenshot Ten:
http://i53.tinypic.com/67t6j6.png

Now a window opens with the main folder. Open the cs folder and then go to cstrike and open it. Find the file "server.cfg" and double click it. The editor of WinSCP will open. Paste the generated server configuration from the website and save it. Don't forget to create banned.cfg and listip.cfg and upload both to the cstrike folder.


After you done the server.cfg go back to the cs folder and right click somewhere and select "New..." then select file and name it run_server. Open it with the editor (double click it) and paste this code: http://pastebin.com/f4jyaP9q and adjust the commands.

+ip = external/ internal IP of your server.
-port = port used for the game (e.g: 27015 or whatever).
+maxplayers = amount of slots from 1 to 32.
+map = map used when server is starting (must be in /cstrike/maps/).
-pingboost 3 = will boost your pings so you can play well.

It could look like this after adjustments:
./hlds_i686 -game cstrike -autoupdate +ip 84.178.232.23 -port 27015 +maxplayers 32 +map de_dust2 -pingboost 3

After this save this file and go back to putty and type chmod u+x run_server. Type "ls" and see if its green, if not repeat chmod u+x... again until its green.


We have finished step four.

Step Five:
Now we need to install tmux. Type "su" and enter the root password. After that type "apt-get install tmux", wait until the installation of tmux is done and type "exit".

Run tmux by typing "tmux" and it will launch tmux and open the first terminal panel. Type "cd cs" and then type "./run_server". Your server should start.

If your server does not start feel free to ask for help here. If it starts you have done it :).

Tmux notice: After you have started a session again type tmux attach to join tmux if needed. If you want exit a session press CTRL + B then D and tmux will detach so you can close putty.


Proof:

Server was online and shown in internet/favourite tab:

http://i52.tinypic.com/xcrebl.png
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple HTTP Server on Linux Serial Thrilla 16 4,144 07-27-2012, 11:38 AM
Last Post: RichardGv
  Create a fully working Counter Strike server with HLDS Serial Thrilla 0 912 05-30-2011, 01:03 AM
Last Post: Serial Thrilla

Forum Jump: