![]() |
|
|
Thread Tools |
|
#1
|
|
|
Bunny Hopper
![]() Join Date: May 2007
Posts: 176
BT Rep: +18
![]() ![]() ![]() |
NaQ's Complete Setup Guide for Linux Seedboxes (Fedora Core/CentOS/Debian/Ubuntu)
Complete Setup Guide for Linux SeedboxesThis guide will help you setup your newly purchased server with uTorrent, FTP server, Firefox, and more. Instructions for rtorrent and Torrentflux are also available, but we recommend uTorrent as it is the most user-friendly, and reported to work well even with only 256MB of RAM. The general principal of this guide will be to setup your server in a secure manner, and perhaps will get you to learn a bit about the Linux system along the way. Questions, comments, corrections, and suggestions are welcomed. When asking for help, please post as much details as possible about your problem, such as the OS, error messages, and a log file if available. Updates: 11/03 - More tweaks and corrections. Updated the wine setup. Added to the FAQ about wine with instructions to compile wine for Debian. Removed webui.zip instructions as it's not needed with the latest uTorrent.Thanks to the following people: roikoThanks to the following websites: GentooPrograms needed: PuttyIndex: 1. Initial Login 2. Initial Setup 3. Install Softwares 4. Create User 5. Setup VNC Desktop 6. Setup uTorrent & WebUI 7. Setup VSFTPD 8. Security: - Change FTP & SSH Ports9. Miscellaneous: - Firefox & Flash10. FAQ 11. History 1. Initial login So you've finally received the email after waiting so impatiently for your server. Now what to do? Run Putty, of course. Enter the IP Address of your server like shown, click Open. Enter the root login information as provided in the email, and you should be able to login to your server. You are now in a Putty terminal, connected to your server through a secure protocol called SSH. Tips for Putty:2. Initial Setup The CLI The Command Line Interface (what you see in front of you as you successfully login through Putty) is what we'll use throughout this guide to setup your server. Some simple commands you can type to get familiar: - Shows the present working directory. Code:
# pwd - Lists the files and folders in the present directory. Code:
# ls - Like "ls", but also lists all hidden files and folders. You'll see that files and folders starting with "." (like .ssh/) are hidden. Code:
# ls -a - Change directory to the root directory. NOTE: /root is the home folder of the root user. Code:
# cd / - Change directory to the home folder. Since you are login as root, you are now back in /root/. Code:
# cd ~/ Go HERE for a comprehensive list of basic commands you can do.Change root password We want to change the most important password of the server, so your provider doesn't know it. A strong password is highly recommended. Code:
# passwd New password: Verify: Delete SSH key authentication Certain providers create SSH authentication keys that will allow them to login to your server as root without actually knowing the password. We want to delete the authorized_keys2 file if it's there: Code:
# ls .ssh authorized_keys2 # rm .ssh/authorized_keys2 Note: Try the auto-complete feature by just typing "rm .ssh/au", then press Tab, and the rest of the filename will fill automatically.Nano - The text editor In Linux, you'll find yourself editing a lot of text files. Nano is a simple CLI text editor that you'll be using throughout this guide. Code:
# nano You are now in nano. The text you see on the bottom of the terminal is the various commands. For our purpose, all you need to know is "WriteOut" and "Exit", which is save and quit. The "^" character denotes the Ctrl key. So to save a file, press Ctrl+O, and to quit is Ctrl+X. Just exit nano for now.Disable SELinux (Not applicable to Debian/Ubuntu systems, AFAIK) Some servers come with SELinux enabled which will cause some problems later on, specifically with FTP setup (user login & SSH/TLS setup). Please comment if you have a workaround without turning SELinux off. But for now, we'll just disable it if it's enabled. Code:
# cat /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0 If you see the line SELINUX=disabled or you don't have this file, move on to the next section. Code:
# nano /etc/sysconfig/selinux change "SELINUX=..." to "SELINUX=disabled". Save & exit. Code:
# reboot Wait a few minutes (and maybe cross your fingersSystem Updates Linux distributions use package management systems to easily install and maintain softwares. Fedora Core and CentOS use "yum", Debian and Ubuntu use "apt". Now, we'll add a few extra repositories (servers with additional softwares for your system) to yum and apt, and then do a system-wide update before continuing on with installing softwares. Each system has its own procedure, so follow the one you have accordingly. Fedora Core 4: Code:
# cd /etc # mv yum.conf yum.conf.bak # wget http://www.fedorafaq.org/fc4/samples/yum.conf # rpm -Uvh http://www.fedorafaq.org/fc4/yum # yum update Say yes when asked to update all softwares. Fedora Core 5: Code:
# cd /etc # mv yum.conf yum.conf.bak # wget http://www.fedorafaq.org/fc5/samples/yum.conf # rpm -Uvh http://www.fedorafaq.org/fc5/yum http://rpm.livna.org/livna-release-5.rpm # yum update Say yes when asked to update all softwares. Fedora Core 6: Code:
# rpm -Uvh http://www.fedorafaq.org/fc6/yum http://rpm.livna.org/livna-release-6.rpm # yum update Say yes when asked to update all softwares. NOTE: Thanks to The Unofficial Fedora FAQ for the instructions above. CentOS 4/5: Code:
# nano /etc/yum.repos.d/Extra.repo Copy & paste the following into the Extra.repo file: Code:
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 [kbs-CentOS-Extras] name=CentOS.Karan.Org-EL$releasever - Stable gpgcheck=1 gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt enabled=1 baseurl=http://centos.karan.org/el$releasever/extras/stable/$basearch/RPMS/ [kbs-CentOS-Misc] name=CentOS.Karan.Org-EL$releasever - Stable gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt gpgcheck=1 enabled=1 baseurl=http://centos.karan.org/el$releasever/misc/stable/$basearch/RPMS/ Save & exit. Code:
# rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt # rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt # yum update Say yes when asked to update all softwares. Debian & Ubuntu: Install the wine repository: Code:
# wget http://wine.budgetdedicated.com/apt/387EE263.gpg # apt-key add 387EE263.gpg # wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list Ubuntu Intrepid Ibex (8.10): Code:
# wget http://wine.budgetdedicated.com/apt/387EE263.gpg # apt-key add 387EE263.gpg # wget http://wine.budgetdedicated.com/apt/sources.list.d/intrepid.list -O /etc/apt/sources.list.d/winehq.list Next, run a system update: Code:
# apt-get update # apt-get upgrade Say yes when asked to update all softwares. Code:
# nano /etc/apt/sources.list Insert the following line to the end: Code:
deb http://www.backports.org/debian etch-backports main contrib non-free Save and exit. Code:
# wget http://backports.org/debian/archive.key # apt-key add archive.key Run update: Code:
# apt-get update You can also run "apt-get -t etch-backports upgrade", but it's not necessary.3. Install Softwares The following softwares will be installed in one easy command: Code:
# yum install vnc-server wine xterm fluxbox vsftpd firefox vnstat Say yes when asked. You'll see many dependencies packages being installed as well. Code:
# apt-get install vncserver wine xterm fluxbox vsftpd firefox vnstat # update-menus Say yes when asked. You'll see many dependencies packages being installed as well. Code:
# apt-get install xfonts-base xfonts-75dpi xfonts-100dpi Optional for Debian: Install a newer version of fluxbox: Code:
# apt-get -t etch-backports install fluxbox We do not want to use root as a user, since root is an administrative account with full control over your server, it is not meant to be used due to possible screwups and security purposes. Therefore, we'll create a new user to use. Code:
# useradd -m pirate Note: Replace pirate with any username you like. Code:
# passwd pirate New password: Verify: Now we can login to Putty again with this new user account. Right-click on Putty's title bar, select "Duplicate Session", and login with pirate. You can close the old Putty window that is logged in under root.5. Setup VNC Desktop Now that we are logged in as a new user. Notice first, where your home folder is located Code:
$ pwd /home/pirate Note: Notice the "$" sign used above. From now on, this means the command is executed under the user account. And "#" is for commands executed under the root account. Code:
$ mkdir .vnc $ nano .vnc/xstartup Insert the following into the xstartup file: Code:
fluxbox Save and exit. Code:
$ chmod +x .vnc/xstartup That's all we needed in order to start up our VNC Desktop. Since this is the first time you start vncserver, you'll be asked to enter a new password for access to the VNC Desktop. For simplicity, you can just use the same password for your user account here. Code:
$ vncserver :1 New 'your.hostname:1 (pirate)' desktop is your.hostname:1 Starting applications specified in /home/pirate/.vnc/xstartup Log file is /home/pirate/.vnc/your.hostname:1.log The above command will be used whenever you want to start a new VNC Desktop, for instance if when your server crash and you need to start things up again. Code:
$ vncserver -kill :1 Killing Xvnc process ID 3489 Launch VNC Viewer. Enter the address of your server in VNC Viewer as shown below. And remember, the address is "your.ip:1". TightVNC Viewer: Code:
$ vncpasswd Note: If you are setting up the 2nd VNC Desktop for another user, remember that you'll have to use a different display number. For example: "$ vncserver :2". Then connect to "your.ip:2" in VNC Viewer. Troubleshoot: If you are unsuccessful here in connecting to your VNC Desktop, please post in this thread the VNC Viewer error and the VNC log, which can be displayed by: Code:
$ cat .vnc/your.hostname.log Sample VNC connection error:
Code:
# iptables -t filter -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination The above output means there is no firewall. If your output has entries under the 3 chains (INPUT, FORWARD, OUTPUT) and/or has more chains, then we'll need to flush the iptables: Code:
# iptables -F List the table again to make sure it's empty. Then try to connect with VNC Viewer again. Code:
_X11TransSocketINETConnect() can't get address for your.hostname: Name or service not known If you get this error, open the hosts file: Code:
$ su # nano /etc/hosts Make sure the file has the following two lines: Code:
127.0.0.1 localhost your.ip your.hostname Replace "your.ip" & "your.hostname" with the ones for your server. If you don't know your hostname, type: Code:
# hostname Then restart the vncserver using the commands above.6. Setup uTorrent & WebUI From now on, you can close the Putty program as we'll use the xterm terminal in the VNC Desktop. As you successfully login to your remote desktop, you'll see a blank screen with a taskbar on the bottom. Right-click anywhere on the desktop for the fluxbox menu, and find xterm (usually under Terminals). xterm is just another terminal like Putty. It's time to install uTorrent, in the new xterm window, type: Code:
$ wget http://download.utorrent.com/1.8.1/utorrent.exe The latest uTorrent (version 1.8.1) is now downloaded to your home folder. Start uTorrent: Code:
$ wine utorrent.exe Suggested tips to configure uTorrent: - Use Speed Guide and set your connection to "xx/100Mbps" or "xx/10Mbps" depending on what you have All set.7. Setup the FTP Server (VSFTPD) You can setup a FTP Server on your seedbox to transfer files to and from your home PC. This is quite advantageous since you most likely will be able to download files from your server to your PC at the maximum speed provided by your ISP, as well as reducing the need to use Bittorrent at home. Code:
$ su Password: # Here, we need to enter the root password to switch to the root user. Code:
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /root/vsftpd.pem -out /root/vsftpd.pem The command above will ask you a bunch of information. Insert whatever you like. Code:
Fedora Core/CentOS: # yum install openssl Debian/Ubuntu: # apt-get install openssl Now it's time to configure VSFTPD through editing the vsftpd.conf file: Code:
# nano /etc/vsftpd/vsftpd.conf Debian & Ubuntu: Code:
# nano /etc/vsftpd.conf Relevant changes: Code:
# /etc/init.d/vsftpd start Starting vsftpd for vsftpd: [ OK ] When making changes to vsftpd.conf, you'll need to restart VSFTPD, to do so: Code:
# /etc/init.d/vsftpd restart Shutting down vsftpd: [ OK ] Starting vsftpd for vsftpd: [ OK ] To have VSFTPD autostart on boot: Code:
# chkconfig vsftpd on Debian & Ubuntu: Code:
# update-rc.d vsftpd defaults Now, you can try to login to your server using the FTP Client of your choice with your pirate account. Make sure to select the connection type as "FTP with TLS/SSH". Code:
# exit $ Note: See Section 8 to change the default ports for the FTP & SSH services.8. Security This section will deal with setting up various security features on your server.Change FTP & SSH Ports FTP & SSH use ports 21 & 22 respectively. These two ports are under constant brute force login attempts by bots trying to compromise systems. Therefore, we want to change them. Code:
$ su Fedora Core & CentOS: # nano /etc/vsftpd/vsftpd.conf Debian & Ubuntu: # nano /etc/vsftpd.conf
Code:
# /etc/init.d/vsftpd restart Shutting down vsftpd: [ OK ] Starting vsftpd for vsftpd: [ OK ] # exit $ Change SSH Port: Code:
$ su # nano /etc/ssh/sshd_config Change the following line: Code:
# Port 22 to Port 54322
Code:
Fedora Core & CentOS: # /etc/init.d/sshd restart Debian & Ubuntu: # /etc/init.d/ssh restart Stopping sshd: [ OK ] Starting sshd: [ OK ] # exit $ Secure VNC through a SSH Tunnel Notice so far, we are using 4 network services/programs. They are SSH, FTP, VNC, and Bittorrent. SSH is a secure protocol. We've setup FTP to use a secure authentication method, although the transferring of data isn't so (Note: you can use SFTP for secure FTP transfers, but at the cost of speed). VNC isn't a secure service, so we'll use a SSH's feature called tunnel to encrypt the traffic. Code:
$ vncserver -kill :1 Killing Xvnc process ID 3489 This command will start a VNC Desktop that will only allow connection from the same machine: Code:
$ vncserver -localhost :1 Tip: For a bigger resolution VNC Desktop, you can add the "-geometry" syntax, like so: Code:
$ vncserver -localhost -geometry 1920x1080 :1 Note: If you already start vncserver without setting the geometry, then you'll need to kill it first. Replace 1920x1080 with any resolution you prefer. Close Putty and open a new Putty window on your PC, enter the IP & Port information for SSH. On the left window, go to Connections - SSH - Tunnels. Under "Add new forwarded port:", insert the following: Go back to Session on the left window, we'll save the Putty settings for convenience. Under "Saved Sessions", insert any name you like, and click Save. From now on, to connect to your server with Putty, just double click on the Saved Session. The tunnel for VNC will also be loaded automatically as well. Troubleshoot: If VNC Viewer reports connection refused, try checking for a proper hosts file on your server. The instruction is in Section 5 (Setup VNC Desktop).Configure Firewall with Firestarter Linux comes with a powerful tool called iptables to intercept and manipulate network packets. We'll setup iptables in this section to be the firewall for the server. Since manually configuring iptables is beyond the scope of this guide, we'll use a GUI frontend to iptables called Firestarter. Let's install Firestarter. Code:
$ su # yum install firestarter # exit $ CentOS 5: Code:
$ wget http://centos.karan.org/el4/extras/stable/i386/RPMS/firestarter-1.0.3-1.i386.rpm $ su # yum install firestarter-1.0.3-1.i386.rpm # exit $ Debian & Ubuntu: Code:
$ su # apt-get install firestarter # exit $ In your VNC Desktop, open a new xterm, start Firestarter: Code:
$ firestarter
Code:
$ su # visudo You are now looking at the sudoers file using "vi" which is another text editor. Press "i" for Insert Mode to edit text, insert the following to the end, after the same line for "root": Code:
pirate ALL=(ALL) ALL
Code:
# exit $ sudo firestarter [sudo] password for pirate: Type your pirate's password here. Code:
$ su # nano /etc/vsftpd/vsftpd.conf Note: for Debian & Ubuntu users, the config file is in a different location, type: # nano /etc/vsftpd.conf Insert the following lines to the end: Code:
pasv_min_port=54323 pasv_max_port=54340 Save and exit. Code:
# iptables -t filter -L Tip: To monitor the firewall without running Firestarter, open a new xterm, type: Code:
$ su # tail -f /var/log/messages The above command actively updates the terminal when new entries are added to the system log. To exit from "tail", press Ctrl+C. The file "/var/log/messages" contains all events log for your server. It is wise to keep an eye on it from time to time to find out if anything is wrong.Encrypt the Hard Drive with Truecrypt TBASecure SSH Thanks to The Fedora Unity Project for portions of this section. Code:
# nano /etc/ssh/sshd_config We had setup an alternate port previously: Code:
Port 54322 Make sure SSH only uses Protocol 2: Code:
Protocol 2 Allow root login only through key authentication. We don't want to disable root login altogether, since if you haven't notice, certain things can only be done under root login. Code:
PermitRootLogin without-password Limit the maximum number of simultaneous unauthenticated connections: Code:
MaxStartups 3:50:10 Reduce the amount of time allowed to successfully login to 30 seconds: Code:
LoginGraceTime 30 Allow only known users: Code:
AllowUsers root pirate Enable key authentication: Code:
RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys Save and exit. Code:
# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: e8:41:87:32:13:25:93:b5:ae:3a:76:ce:14:fe:9a:b5 root@hostname
Code:
# mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys Note: if you are creating a 2nd pair of keys for the same user, we'll have to add the public key to the existing authorized_keys file instead: Code:
# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Code:
Fedora Core & CentOS: # /etc/init.d/sshd restart Debian & Ubuntu: # /etc/init.d/ssh restart Stopping sshd: [ OK ] Starting sshd: [ OK ] # exit $ Close the existing Putty session and open a new one. Hopefully, you already have a Saved Session by now. Select it and click Load. If not, enter your IP & Port information. On the left window, go to Connection - SSH - Auth. Under "Private key file for authentication", browse to your private_key.ppk file. Code:
PasswordAuthentication no Restart the SSH server for the change to take effect.9. Miscellaneous This section contains additional and optional configurations for your server.Firefox & Flash You probably noticed we've already installed Firefox from Section 3. To launch it, just right-click on the VNC Desktop for the fluxbox menu, locate Firefox and click. If you need the Flash plugin for Speed Tests, follow these instructions: Fedora Core 4: Code:
$ su # yum --enablerepo=flash install flash-plugin # exit Fedora Core 5/6 & CentOS: Code:
$ su # yum install flash-plugin # exit Ubuntu: Code:
$ su # apt-get install flashplugin-nonfree # exit $ Debian: (Assuming you installed Backports in Section 2) Code:
$ su # apt-get -t etch-backports install flashplugin-nonfree # exit $ Start or restart Firefox.Install rtorrent If you don't like uTorrent for whatever reasons, rtorrent is a good alternative. rtorrent runs in a terminal and isn't as easy to use, but I hope by now, you are more familiar and not affraid of the Linux ways. Code:
$ su # yum install rtorrent # exit $ Debian & Ubuntu: TBA Note: If rtorrent cannot be installed with the instructions above, you'll need to manually compile and install it. For that, as well as instructions for rtorrent, please see fstokebanget's "How to install and use rtorrent properly in CentOS" guide.Install Torrentflux TBAConfigure the Fluxbox Menu You can configure the fluxbox menu to your liking. Here is an example: Note: Use Putty instead of xterm to copy & paste text. Code:
$ nano ~/.fluxbox/menu Edit it to look like this: Code:
[begin] (Fluxbox-1.0.0)
[encoding] {UTF-8}
[exec] (firefox) {firefox}
[exec] (xterm) {xterm}
[exec] (uTorrent) {wine ~/utorrent.exe}
[submenu] (fluxbox menu)
[config] (Configure)
[submenu] (System Styles) {Choose a style...}
[stylesdir] (/usr/share/fluxbox/styles)
[end]
[submenu] (User Styles) {Choose a style...}
[stylesdir] (~/.fluxbox/styles)
[end]
[workspaces] (Workspace List)
[submenu] (Tools)
[exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg}
[exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png}
[exec] (Run) {fbrun }
[exec] (Regen Menu) {../util/fluxbox-generate_menu }
[end]
[submenu] (Window Managers)
[restart] (mwm) {mwm}
[restart] (kde) {startkde}
[end]
[commanddialog] (Fluxbox Command)
[reconfig] (Reload config)
[restart] (Restart)
[exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) 2> /dev/null | xmessage -file - -center}
[separator]
[exit] (Exit)
[end]
[endencoding]
[end]
Save and exit.Configure Multiple IP Addresses (Only for Fedora Core/CentOS right now) Code:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:0b:6a:34:2a:9b ONBOOT=yes NETMASK=255.255.255.0 IPADDR=192.168.1.5 GATEWAY=192.168.1.1 TYPE=Ethernet Create another network interface for your 2nd IP: Code:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0/ etc/sysconfig/network-scripts/ifcfg-eth0:0 # nano /etc/sysconfig/network-scripts/ifcfg-eth0:0 Modify DEVICE and IPADDR in this file to reflect your 2nd IP: Code:
DEVICE=eth0:0 HWADDR=00:0b:6a:34:2a:9b ONBOOT=yes NETMASK=255.255.255.0 IPADDR=192.168.1.6 GATEWAY=192.168.1.1 TYPE=Ethernet Save & exit. Code:
# ifup eth0:0 To see all the network interfaces: Code:
# ifconfig You should see the details for eth0, eth0:0, and lo Code:
C:\>ping 192.168.1.6
Pinging 192.168.1.6 with 32 bytes of data:
Reply from 192.168.1.6: bytes=32 time=1ms TTL=127
Reply from 192.168.1.6: bytes=32 time=1ms TTL=127
Reply from 192.168.1.6: bytes=32 time=1ms TTL=127
Reply from 192.168.1.6: bytes=32 time=1ms TTL=127
Ping statistics for 192.168.1.6:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
Troubleshoot: If you cannot ping your 2nd IP, please make sure you follow the steps above exactly. Make sure your ifcfg-eth0:0 file is correctly setup. Make sure you see eth0:0 when issuing "ifconfig". And finally, you can confirm with your provider that the information is properly given and setup. Code:
user1's uTorrent: net.bind_ip: 192.168.1.5 net.outgoing_ip: 192.168.1.5 user2's uTorrent: net.bind_ip: 192.168.1.6 net.outgoing_ip: 192.168.1.6 2. Using iptables Code:
# cat /etc/passwd Your account is listed at the end, like so: Code:
# iptables -t nat -A POSTROUTING -m owner --uid-owner 500 -j SNAT --to 192.168.1.6 See if the above commands works: Code:
# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- anywhere anywhere OWNER UID match pirate to:192.168.1.6
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Save the iptables: Code:
# iptables-save > /etc/sysconfig/iptables Have iptables start on boot and load the saved config: Code:
# chkconfig iptables on Debian & Ubuntu: Code:
# update-rc.d iptables defaults You only need to add an entry to iptables for the 2nd user and any additional users. It's also fine to add an entry for the 1st user if you want.Using vnstat to monitor bandwidth usage Depending on your provider, your server may not come with bandwidth monitoring. If so, you will have to monitor the bandwidth to prevent paying overage fee due to using more than the allowed limit yourself. From section 3, we already installed vnstat, which is a simple tool for bandwidth monitoring.10. FAQ What is a seedbox? Where can I buy one? Which server should I buy? For all these questions, see fatcat69's Seedbox FAQ and 007's BT Dedicated Server/Seedbox.Which Linux distribution should I choose? The 4 main distributions available when renting a server are CentOS, Debian, Fedora Core, and Ubuntu. Any of them will be fine, since this guide has instructions for all of them. If you can't choose one, just flip a coin.Why a Linux server instead of a Windows server? The main reason is price. On average, renting a server with Windows cost between $15 - $20 more. If you don't know Linux at all, and think following this guide is too hard, then Windows might be a better option.Is Linux better than Windows for a seedbox or vice versa? This is a user's preference and experience question as both can work equally well.I got Disk Overloaded Errors and my speed dropped, how do I prevent this? Disk overloaded errors appear when the download speed is too fast for the hard drive to physically keep up. uTorrent uses your RAM as cache to store downloaded data that is waiting to be written to the HD. The screenshot below shows the cache getting filled up, which leads to the performance drop:I received the error "Too many open files" in uTorrent? You may receive this error when you download a very large torrent and/or running many torrents. The problem has to do with the default Linux limit of allowed open files per user (1024). Go HERE for the solution (edit the file /etc/security/limits.conf)uTorrent keeps dropping peer connections ("Peer error: error 10022") This problem is due to a bug in wine from version 0.9.40 up to 1.1.5. The latest version is 1.1.6, which fixed this issue. As of 10/16, if you follow this guide, the version of wine you should have is (after updating to the latest): Code:
# apt-get remove wine - Install the necessary tools to compile wine: Code:
# apt-get build-dep wine Debian 64-bit users will need some extra packages: # apt-get install libc6-dev-i386 lib32z1-dev - Download and extract the latest source: Code:
# wget http://internap.dl.sourceforge.net/s...-1.1.7.tar.bz2 # tar xvjpf wine-1.1.7.tar.bz2 - Enter the folder containing the soure files you just extracted: Code:
# cd wine-1.1.7/ - Compile and install wine: Code:
# ./configure && make && make install Note: this process will take at least half an hour on most servers. Code:
# wine --version wine-1.1.7 3/08 - Added a firewall troubleshoot for Section 5. Added the FAQ, not much there now, just some general answers and info about disk overloaded. Still to come: SSH Configs, Setup FreeNX, and how to use vnstat. Truecrypt isn't performing well under testing, so the guide for that might take a while. And if the performance doesn't improve, I won't write it. Went through the whole guide carefully to correct grammar and spelling mistakes as best as I can. Made a few adjustments and additions along the way. 3/02 - Well, I didn't get anything done this weekend. Real life got in the way...I'll definitely try to complete the missing parts by next weekend. Did a few minor adjustments. Will also plan to add "FreeNX, an alternative to VNC" and "Monitoring bandwidth with vnstat". Will probably separate Miscellaneous into Security and Miscellaneous. Will add more stuff into Security about prevention and detection. Last edited by naq; 11-04-2008 at 06:54 PM.. |
|
|
| The Following 32 Users Say Thank You to naq For This Useful Post: | Alpha2 (04-18-2009), b4rt (06-29-2009), barakokula (07-23-2009), Buddha.net (05-23-2009), Cabalo (12-09-2009), DV8type (10-03-2009), Eros (06-20-2009), Hajah (05-21-2009), himanshuaieee (07-03-2009), jobinjv (04-17-2009), Juihi (09-09-2009), lee551 (12-02-2009), manu1991 (03-23-2009), Mendieta (02-07-2010), mrmani (07-24-2009), mrseed (09-12-2009), n00bz0r (01-16-2010), notho (05-21-2009), pivokozel (04-06-2009), predateur (03-18-2009), redMonster (06-22-2009), Rilly (06-06-2009), Slickerey (12-17-2009), sriups (12-22-2009), Telejeesus (08-08-2009), tesco (12-28-2009), teslafied (08-26-2009), TheMegaKing (04-16-2009), top (04-14-2009), VinX (05-12-2009), xuxoxux (06-29-2009), zonta (11-30-2009) |
| Click to Register | Registering will remove these ads. |
|
Sponsored Links
|
|
Guides and Tutorials
-
#2
|
|
|
Join Date: Aug 2007
Age: 19
Posts: 573
|
Awesome job so far, nice work
|
|
|
|
Guides and Tutorials
-
#3
|
|
|
Poster
![]() Join Date: Aug 2007
Posts: 266
BT Rep: +1
|
Thanks for this great guide!
You did all the home work on this one! I'm' going to set my seedbox this weekend and you have made it look easy Again great job. |
|
|
|
Guides and Tutorials
-
#4
|
|
|
Join Date: Oct 2007
Location: spamming ur mom and sis.
Age: 23
Posts: 1,756
BT Rep: +25
![]() ![]() ![]() ![]() ![]() |
Came out great! =D
__________________
Funniest Post Seedbox FAQ for Non Owners and Owners ***** Getting files off of your Seedbox Securely (FTP w/SSL) ***** Linux Seedbox Guide I only sell invites on ebay, sorry guys, so dont bother pm'ing me. |
|
|
|
Guides and Tutorials
-
#5
|
|
|
BANNED
|
Holy Crap!
![]() ![]() ![]() Nice Guide Bud!
|
|
|
|
Guides and Tutorials
-
#6
|
|
|
Poster
![]() Join Date: Apr 2007
Posts: 39
|
Nice work and i'm glad i didn't make any mistake while i was testing mine ^^. I just have some really small new actions :
- Some protection for ssh http://fedorasolved.org/post-install...s/securing-ssh
http://www.adobe.com/shockwave/downl...ShockwaveFlash I'm on fedora 6 and yum install flash-plugin didn't find anything I'm now looking forwad to the truecrypt configuration (or any configuration for any way to encrypt my disk such as cryptsetup for some linux release^^) because that's where i spent some time without managing to encrypt them ^^ Thanks a lot for that tuto and nice job |
|
|
|
Guides and Tutorials
-
#7
|
|
|
Poster
![]() Join Date: Dec 2007
Posts: 167
BT Rep: +1
|
So are you saying a linux seedbox can run utorrent with much less ram than a windows seedbox?
|
|
|
|
Guides and Tutorials
-
#8
|
|||
|
Bunny Hopper
![]() Join Date: May 2007
Posts: 176
BT Rep: +18
![]() ![]() ![]() |
Quote:
I will add some SSH configs in the FAQ. Have you tried adding the extra repos for the flash-plugin? I only know for sure what I wrote would work for CentOS. IIRC, the flash repo installed in Section 2 might not be enabled by default in Fedora. I'd have to get on a FC6 machine to test... About firewall & truecrypt, I'm planning to write those sections, but actually, I've never set them up before .Quote:
I'm not saying that. I've also never used a Windows server. EDIT: Ok, about flash-plugin for Fedora, I haven't test it yet, but according to fedorafaq.org, "yum install flash-plugin" should work. It's only FC4 that has the flash repo disabled, so you'd need this command instead: # yum --enablerepo=flash install flash-plugin I'll update the guide with this info Last edited by naq; 02-29-2008 at 12:19 PM.. Reason: Automerged Doublepost |
||
|
|||
|
Guides and Tutorials
-
#9
|
|||
|
Poster
![]() Join Date: Apr 2007
Posts: 39
|
Quote:
Quote:
About fedora 6, i search about ways to encrypt my disk and i find two of them : - cryptsetup-LUKS: so far i haven't be able to use it and it might be because the fedora release of OVH isn't modular. - truecrypt: so far, i only some simple thing (like using the bin inside the rpm,...) but nothing worked. And everybody seems to say that in order to run truecrypt with fedora, i have to rebuild the kernel with it. If i have some time this week end, i'm going to try it and i will post the result. In the mean times, if you have anything about that do not hesitate (i'm kind of a newbe with linux (with some basic ^^)) |
||
|
|||
|
Guides and Tutorials
-
#10
|
|||
|
Bunny Hopper
![]() Join Date: May 2007
Posts: 176
BT Rep: +18
![]() ![]() ![]() |
Quote:
http://gentoo-wiki.com/HOWTO_Truecrypt I also have the firewall up and running fine with firestarter, I'll write that guide tomorrow. Last edited by naq; 02-29-2008 at 01:49 PM.. |
||
|
|||
![]() |
| Bookmarks |
| Thread Tools | |
|
|