English   German

Go Back   TeamSpeak Community Forums > TeamSpeak Legacy Versions > [TeamSpeak 2] Server Support

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-05-2003, 18:36
askwar askwar is offline
-= TeamSpeak User =-
 
Join Date: May 2003
Location: Planet Earth
Posts: 4
askwar is on a distinguished road
Lightbulb Guide to running the server securely (chroot)!

Hello.

On my server, I've setup TSS2 to run in chroot. A chroot is a directory into which a process changes and afterwards cannot leave it. This is good practice security wise, because even if there are security holes which allow the server process to be overtaken, the attacker can not leave the chroot directory.

To do so, I had to make sure that the process is able to run in this restricted environment. This means, that I created the following directories:
  • etc
  • dev
  • lib
  • tmp
  • usr
  • usr/lib
  • usr/lib/gconv
  • usr/lib/locale
  • var
  • var/run

These directories are all in the installation directory of the TSS2 server.

I then copied the following files into the corresponding directories in the chroot:
  • /etc/group
  • /etc/ld.so.conf
  • /etc/localtime
  • /etc/passwd
  • /lib/ld-linux.so.2
  • /lib/libc.so.6
  • /lib/libdl.so.2
  • /lib/libncurses.so.5
  • /lib/libpthread.so.0
  • /usr/lib/gconv/ISO8859-15.so
  • /usr/lib/gconv/gconv-modules
  • /usr/lib/locale/locale-archive

TSS2 needs /dev/null, which has to be created in the chroot (took me QUITE a while to figure that out ). As root, change into the dev directory in the installation directory and do:


mknod null c 1 3
chmod 0666 null


With the attached startup script, I'm successfully starting TSS2 rc2 on my Debian Woody (3.0) server.

Cheers,

Alexander
Attached Files
File Type: txt tss2.debian_chroot_startscript.txt (2.0 KB, 909 views)
Reply With Quote
  #2  
Old 11-06-2003, 00:02
bhurley77
Guest
 
Posts: n/a
Red Hat 9 chroot server operation

Thanks for pointing the way, you saved me a lot of time. I adapted your instructions to RedHat 9 in the attachment.

Cheers,

Brian
Attached Files
File Type: txt tss2serverd.txt (2.6 KB, 640 views)

Last edited by bhurley77; 11-06-2003 at 23:03.
Reply With Quote
  #3  
Old 24-06-2003, 16:07
evil_bunnY evil_bunnY is offline
-= TeamSpeak User =-
 
Join Date: Jun 2003
Location: netherlands
Posts: 15
evil_bunnY is on a distinguished road
it sounds, nice, except if you copy /etc/group and /etc/shadow, you might as well not bother with the chroot, because it'll just delay things.
(explanation: you can just let jack the ripper loose on the shadow file, and it'll take a while, but it'll break it.)
might improve the situation by moving to another type of encryption, like 3DES instead of MD5.
Reply With Quote
  #4  
Old 24-06-2003, 16:55
askwar askwar is offline
-= TeamSpeak User =-
 
Join Date: May 2003
Location: Planet Earth
Posts: 4
askwar is on a distinguished road
I don't know anymore, did I write to copy these files? You're right of course that this is bad. However, you can also put some dummy files there with no/wrong authentication details in /etc/shadow.

But where's the risk in copying /etc/group?
Reply With Quote
  #5  
Old 25-06-2003, 23:05
evil_bunnY evil_bunnY is offline
-= TeamSpeak User =-
 
Join Date: Jun 2003
Location: netherlands
Posts: 15
evil_bunnY is on a distinguished road
Quote:
Originally posted by askwar
I don't know anymore, did I write to copy these files? You're right of course that this is bad. However, you can also put some dummy files there with no/wrong authentication details in /etc/shadow.

But where's the risk in copying /etc/group?

well look in your group file my friend: it lists valid logins.
it wont give the passwords, if for example, if you forbid remote root logins (and you should) on your SSH server (run telnet and "ill kill you") it gives attacker a pretty reliable list of possible logins.
if you have stupid users with weak passwords, bam hes in.

but i have to be honest you didnt tell to copy /etc/shadow, and linux machines without a shadow system are very rare nowadays, so thats a good thing.

remember: the principle of the chroot to give it as little as possible thats connected to/usable on the actuall tree.
hope im clear, just reply if you have questions.


have fun.
Reply With Quote
  #6  
Old 26-06-2003, 06:14
askwar askwar is offline
-= TeamSpeak User =-
 
Join Date: May 2003
Location: Planet Earth
Posts: 4
askwar is on a distinguished road
No, the group file does not (necessarily) list valid logins. It lists group names and their group ids.

But you're right. You shouldn't copy /etc/group and /etc/passwd but it would be better to create new files in the chroot which only list the groups/users that are really necessary.
Reply With Quote
  #7  
Old 22-10-2003, 15:38
mjrwoody mjrwoody is offline
-= TeamSpeak User =-
 
Join Date: Oct 2003
Location: USA
Posts: 11
mjrwoody is on a distinguished road
Re: Red Hat 9 chroot server operation

Quote:
I adapted your instructions to RedHat 9 in the attachment.
For RH 7.3 your startup script and directions worked great with the following tweaks:

- * /lib/libncurses.so.5 -- This doesn't exist. Used /usr/lib/libncurses.so.5 instead, and copied to the correct chroot'ed /home/usr/lib directory.
- * /usr/lib/locale/locale-archive -- This doesn't exist, didn't substitute anything.

Also, i was converting an existing "running as root" server (d'oh!) to chroot. Here's what else i had to do:

/home/tss2 was my home dir. Had to "chown" the whole directory to "teamspeak:teamspeak" recursively (in /home run 'chown teamspeak:teamspeak tss2/ -R')

Thanks for the great script!
Reply With Quote
  #8  
Old 31-10-2003, 22:13
Andrew Myers Andrew Myers is offline
-= TeamSpeak User =-
 
Join Date: Oct 2003
Location: MI, USA
Posts: 3
Andrew Myers is on a distinguished road
Here's another take

Here's yet another TeamSpeak chroot server script (instructions included). Primarily focused on RH9, but there's info that'd probably be useful if you were trying to get it to work on other distros.

[url removed, see message down-thread].

Near as I can tell, I only really needed:

/lib/ld-linux.so.2
/lib/libc.so.6
/lib/libdl.so.2
/lib/libpthread.so.0

and

/dev/null.

I also copied over /lib/libNoVersion.so.1 for good measure, since it shows up on the list if you ldd it.

Didn't seem to need /etc/passwd, /etc/group, or other stuff, the locale stuff, and so forth.

Haven't had it up that long, so perhaps I'm overlooking something, we'll see

Last edited by Andrew Myers; 02-03-2005 at 18:54.
Reply With Quote
  #9  
Old 01-11-2003, 10:39
Peter's Avatar
Peter Peter is offline
-= TeamSpeak Team =-
 
Join Date: Jul 2002
Location: Germany
Posts: 2,524
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
Note:

change root-ing your server is a security thing you can do, but much more important (read: if you dont do this, dont bother with chroot) would be to run the teamspeak process as somebody else than root. Dunno if somebody could write a nice post on how to do that, but you can certanly find some start scripts that do it, if you search for "#!/bin/bash".
__________________
You think my answer is stupid ? Read This:
http://www.catb.org/~esr/faqs/smart-...ons.html#intro

In a world without fences and walls - who needs windows and gates ?
Reply With Quote
  #10  
Old 01-11-2003, 12:05
Brain's Avatar
Brain Brain is offline
-= TeamSpeak Support =-
 
Join Date: Jan 2003
Location: Germany
Posts: 4,141
Brain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond reputeBrain has a reputation beyond repute
... and, maybe even more important, don't use your goldfish's name for your SA account password.
__________________
1f y0u c4n r34d 7h15 y0u r3411y n33d 70 g37 l41d
Reply With Quote
  #11  
Old 01-11-2003, 17:09
Andrew Myers Andrew Myers is offline
-= TeamSpeak User =-
 
Join Date: Oct 2003
Location: MI, USA
Posts: 3
Andrew Myers is on a distinguished road
Quote:
Originally posted by pwk.linuxfan
Note:

change root-ing your server is a security thing you can do, but much more important (read: if you dont do this, dont bother with chroot) would be to run the teamspeak process as somebody else than root. Dunno if somebody could write a nice post on how to do that, but you can certanly find some start scripts that do it, if you search for "#!/bin/bash".
Yep, absolutely true -- the script I posted (as do the others above) run TeamSpeak as the designated user *and* chroot it. The script I linked earlier does just that.

chroot'ing is something that's easy to do in *addition* to running the process as a restricted user.
Reply With Quote
  #12  
Old 01-11-2003, 20:45
Peter's Avatar
Peter Peter is offline
-= TeamSpeak Team =-
 
Join Date: Jul 2002
Location: Germany
Posts: 2,524
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
Well,

i didnt view your script . Maybe you make it clear in your post (edit comes to mind) that it runs a special (non root) user....
__________________
You think my answer is stupid ? Read This:
http://www.catb.org/~esr/faqs/smart-...ons.html#intro

In a world without fences and walls - who needs windows and gates ?
Reply With Quote
  #13  
Old 06-11-2003, 23:38
indy25 indy25 is offline
-= TeamSpeak User =-
 
Join Date: Nov 2003
Location: uk
Posts: 2
indy25 is on a distinguished road
Hmmkay, I'm a bit new to this scripting malarkey, but I've looked thru the scripts here and I have a few questions.

I can see that the debian script will definately run as the tss user as it has a chuid th set the uid of the process.

For the RH9 version, from what I can see, the process will still be run as root. Or does the fact that you've chroot-ed to a directory that is owned by U tss and G tss force it. Note the fact that if a directory is owned by a non-root user and group, root can still run any executable in that directory.

I've run the various scripts that have been available and they run the server as root unless you've logged in as tss user first.
Reply With Quote
  #14  
Old 11-11-2003, 08:04
indy25 indy25 is offline
-= TeamSpeak User =-
 
Join Date: Nov 2003
Location: uk
Posts: 2
indy25 is on a distinguished road
Hokay, fully read thru the script, and got mine running chroot-ed. Didn't notice first read thru the chmod 6700 on server_linux.

Sorry for doubting you guys.
Reply With Quote
  #15  
Old 02-03-2005, 18:57
Andrew Myers Andrew Myers is offline
-= TeamSpeak User =-
 
Join Date: Oct 2003
Location: MI, USA
Posts: 3
Andrew Myers is on a distinguished road
Switched from RH9 to Debian (sarge) a while back; attached is the /etc/init.d/tss2 script I currently use to start TeamSpeak2 as the tss2:tss2 user:group, in a chroot jail.

See tips further up the topic re: which files need to be copied where, etc.
Attached Files
File Type: txt tss2.txt (2.1 KB, 562 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
»»» FAQ - TS 2.x Server Michael [TeamSpeak 2] Server Support 158 29-12-2009 23:20
Flooding ANZEIGE?!? oehlie [TeamSpeak 2] Server Support 12 19-12-2007 22:39
Server stops responding Xeroed [TeamSpeak 2] Server Support 10 27-09-2006 04:08
I can find my IP Barmace [TeamSpeak 2] Server Support 16 21-05-2005 12:01
Running TS1 on a linux server Taipan [TeamSpeak Classic] General Questions 8 04-11-2003 08:31


All times are GMT +1. The time now is 15:26.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Add to Bookmarks   |   Printview   |   Contact Us   |   Legal Notices



You Rated this Thread: