[Ilugc] Restrict users commands

  • From: kapil@xxxxxxxxxxx (Kapil Hari Paranjape)
  • Date: Wed Sep 9 16:49:07 2009

Hello,

On Wed, 09 Sep 2009, Govi wrote:

I want to restrict users normal command.i mean specified users must use only
below command,

1. Make rbash the user's shell using change shell.

2. Set the PATH to something like /usr/local/rbash/bin

        echo "PATH=/usr/local/rbash/bin" >> /home/user/.profile
        chown root.root /home/user/.profile
        chmod og-w /home/user/.profile
        chattr +i /home/user/.profile

3. Link the binaries to this directory

        for i in mv dig telnet ssh
        do 
                ln -s $(type -path $i) /usr/local/rbash/bin/
        done
        chown root.root /usr/local/rbash/bin/

4. Test it out! (Perhaps you need to copy or hard link the binaries
and symbolic links are not allowed).

Regards,

Kapil.
--

Other related posts: