From owner-freebsd-questions@FreeBSD.ORG Sat Mar 14 00:59:22 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476E7106564A for ; Sat, 14 Mar 2009 00:59:22 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: from ibctech.ca (v6.ibctech.ca [IPv6:2607:f118::b6]) by mx1.freebsd.org (Postfix) with SMTP id D87BA8FC08 for ; Sat, 14 Mar 2009 00:59:21 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: (qmail 83366 invoked by uid 89); 14 Mar 2009 01:03:39 -0000 Received: from unknown (HELO ?192.168.1.114?) (steve@ibctech.ca@::ffff:208.70.104.100) by pearl.ibctech.ca with ESMTPA; 14 Mar 2009 01:03:39 -0000 Message-ID: <49BB0161.3070800@ibctech.ca> Date: Fri, 13 Mar 2009 20:59:13 -0400 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "freebsd-questions@freebsd.org Questions -" X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Execute and lock a user into a program upon login X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2009 00:59:22 -0000 Hi everyone, Although the application of my question focuses on network operation, I believe that the objective fits this list. Mostly irrelevant, I have been working on securing my network perimeter. I have a FreeBSD box that acts as a host-based BGP peer to all edge connected routers. I use this host-based Quagga FBSD router to distribute routes that are to be blackholed by the edge devices. What I want is to set up an environment so that when a specific user logs in to the box via SSH, a command is run, and they immediately get dropped into the environment that the command produces. When they exit this 'command', the login session is dropped. Essentially, I want to 'lock' a user into a program upon SSH login, and drop them from the SSH session when the program terminates. In essence: - user 'router' connects via SSH - user is dropped into the application 'vtysh' - user performs operations - user exits from program - shell drops (ie. user does not have to exit the csh shell to drop the SSH connection) Steve