I have a requirement like this:
I have modified versions of certain internal/external commands that I am putting into some directory say /mydir.
All the users will go an authentication check once they log in and based on the outcome there are two possibilities:
- User passes authentication - No action required.
- User fails authentication - Any command user executes will be looked upon in /mydir first and if modified version of the command is available there it is
executed else normal command will be executed.
I have taken a simple logical approach to achieve this. Change PATH to PATH=/mydir:$PATH from within /etc/profile. Now I want to restrict the users to
revert back to original path. Is there any way to do this?
Also ideally I don't want users to view this modified PATH and allow them to change the PATH but the change should not take place.
Basically I want to achieve something like this:
- User logs in - PATH gets changed to new PATH - User issues PATH command - Original PATH is displayed even though actually PATH is changed and new PATH is
in effect.
2. User tries to change PATH - PATH command is executed - user issues �echo $PATH� to verify - he gets modified PATH displayed but actually PATH is not
changed.
I summary I want to change user's PATH but don't want him to know that this has happened.
Is this possible? Ideally I want to achieve what I have described but if it is not at all possible then at least I want to restrict user from executing
PATH command.
Any ideas?
Thanks in advance and look forward know your thoughts on this.
Regards,
Ramesh