* [Bismark-commits] rev 354 - trunk/server/scripts
@ 2011-05-27 18:10 walter
0 siblings, 0 replies; only message in thread
From: walter @ 2011-05-27 18:10 UTC (permalink / raw)
To: bismark-commits
Author: walter
Date: 2011-05-27 20:10:00 +0200 (Fri, 27 May 2011)
New Revision: 354
Added:
trunk/server/scripts/brsh
Log:
added bismark restricted shell
Added: trunk/server/scripts/brsh
===================================================================
--- trunk/server/scripts/brsh (rev 0)
+++ trunk/server/scripts/brsh 2011-05-27 18:10:00 UTC (rev 354)
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Bismark Restricted Shell
+#
+# Only allows to execute:
+# - scp : to upload measure results
+# - rshell : add recovery tunnel to list
+#
+# author: walter.dedonato@unina.it
+
+#echo $SSH_ORIGINAL_COMMAND
+
+. ~/etc/bdm.conf
+
+cmd=$(echo "$SSH_ORIGINAL_COMMAND" | gawk '
+ ($1 == "scp") && ($(NF-1) ~ "-t") && ($NF ~ "^var/data/") && ! ($NF ~ "\\.\\.") && ! /[;$`]/ { print }
+ ($1 == "rshell") && ! /[;$`]/ { print "bdm settunnel " $2 " " $3 }
+')
+
+$cmd
+
+if [ ${cmd:0:3} == "bdm" ]; then
+ while [ true ]; do
+ read
+ done
+fi
Property changes on: trunk/server/scripts/brsh
___________________________________________________________________
Name: svn:mergeinfo
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-27 19:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 18:10 [Bismark-commits] rev 354 - trunk/server/scripts walter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox