1849374 Members
6225 Online
104044 Solutions
New Discussion

Re: Configured user

 
SOLVED
Go to solution
Rene Mendez_4
Super Advisor

Configured user

Hello

How to configure a user and this user execute ping only.

Regards
Rene
5 REPLIES 5
Rick Garland
Honored Contributor
Solution

Re: Configured user

You can create the user with a restricted shell (rsh) and in the users home directory is a copy of the ping command.

The users .profile will unset the system wide PATH variable and only have PATH=$HOME

James R. Ferguson
Acclaimed Contributor

Re: Configured user

Hi Rene:

One way would be to create a shell script that asks the user for the address or DNS name to ping, does the ping and exits.

Then, create a user account but specify the name of your shell script instead of the usual shell as the program to use for the shell.

Your shell script would look like:

#/usr/bin/sh
trap 1 2 3 ''
echo "Enter IPAddress or hostname\c "
read WHO
/usr/sbin/ping ${WHO}
exit 0

When the user exits, he/she is logged off.

Regards!

...JRF...


Oviwan
Honored Contributor

Re: Configured user

Hi

In the .profile file define the shellvar as a script. In this script allow to execute only ping. after his login, the script start automatically. If the user exit the script then the session will close.

Regards
Geoff Wild
Honored Contributor

Re: Configured user

If the user can only execute ping - why have them login at all - I mean in order to login - they must be using some sort of client - IE Windows - therefore - they already have the ability to run ping from a Command Prompt...

Just my 2 cents as I thought the question was a bit out there...

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rene Mendez_4
Super Advisor

Re: Configured user

Thx a lot