x


How to serve security policy on linux system?

Unity ships sockpol.exe for Windows, and that can be run on Mac with "mono sockpol.exe", but Linux servers are omitted. Presumably they figured if you ran a Linux server you'd know how to do it. Well I didn't, and couldn't find it, so I'm going to answer my own question, because I think it will be useful, and would love it if someone had a better idea.

more ▼

asked Apr 29 '11 at 02:03 PM

Molix gravatar image

Molix
4.8k 17 27 66

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You can use netcat (a.k.a. nc) to listen on a socket and respond to requests. Basically you just create a script that pipes an echo of the domain policy to nc. e.g., create a text file that will be your script, say, domainPolicyServer.sh:

#!/bin/sh
while true; do echo '<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="1-65536"/>
</cross-domain-policy>' | netcat -l 843; done

You'll need to make it executable, and you'll probably want to make sure no one messes with it, e.g.

chmod 700 domainPolicyServer.sh

You can then start that with:

/path/to/file/domainPolicyServer.sh > /dev/null &

That will start it in the background and keep it quiet.

You can also add that command to your /etc/rc.local to ensure it is started at boot up.

This works, but I'm no Linux guru, so feedback is welcome.

more ▼

answered Apr 29 '11 at 02:11 PM

Molix gravatar image

Molix
4.8k 17 27 66

Not really useful to me atm, but upvote for sharing your knowledge/experience with the community!

Apr 29 '11 at 02:44 PM Joshua

Hi, thanks! Maybe it's due to a different "netcat" I have under Debian Squeeze, but I had to change your script slightly to make it work: I used "netcat -l -p 843" instead of "netcat -l 843".

Nov 15 '12 at 04:22 PM attiksystem
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x75
x39
x2
x2

asked: Apr 29 '11 at 02:03 PM

Seen: 1446 times

Last Updated: Nov 15 '12 at 04:22 PM