Operating System - HP-UX
1833277 Members
3236 Online
110051 Solutions
New Discussion

Re: how can i limit that user1 and user2 can't telnet to a hp server?

 
SOLVED
Go to solution
常有慈悲心
Regular Advisor

how can i limit that user1 and user2 can't telnet to a hp server?

user1 and user2 is the hp server's common user,
i don't want them to use telnet.
how can i limit them?
8 REPLIES 8
Mark Grant
Honored Contributor
Solution

Re: how can i limit that user1 and user2 can't telnet to a hp server?

If you don't want them to be able to telnet but you want other people to be able to telnet try the following.

Create a group that everybody is in except user1 and user2 and then change the group of /usr/bin/telnet and set the permissions so that only owner and group can execute telnet i.e chmod 550 /usr/bin/telnet
Never preceed any demonstration with anything more predictive than "watch this"
常有慈悲心
Regular Advisor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

i know ,thank you.
T G Manikandan
Honored Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

you can just add a line "exit" in the user's .profile file.He will not be able to login.

if he is using csh then you can add "logout" in the .cshrc file.


Thanks
Karthik S S
Honored Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

Add this to /etc/profile


#Do not allow telnet sessions for user1 and user2

user=`whoami`

if [ $user = user1 ]
then
exit
else
if [ $user = user2 ]
then
exit
fi
fi

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Naveej.K.A
Honored Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

change the shell of both users to /usr/bin/false.

usermod -s /usr/bin/false user1
usermod -s /usr/bin/false user2

They wont' be able to telnet

regds
Naveej
practice makes a man perfect!!!
Mark Grant
Honored Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

I might be wrong here but I got the impression that the poster wanted to stop the users telnetting out of the machine, not into it.
Never preceed any demonstration with anything more predictive than "watch this"
SANTOSH S. MHASKAR
Trusted Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

Just add alias in .profiles of users user1 and user2 as follows

alias telnet='echo Telnet not allowed!'

Now user1 or user2 will not able to use telnet.


-Santosh
Mark Grant
Honored Contributor

Re: how can i limit that user1 and user2 can't telnet to a hp server?

Nice idea Santosh

However, how would you stop people running "/usr/bin/telnet" or "./telnet" or "../telnet" or "../../bin/telnet" etc etc.
Never preceed any demonstration with anything more predictive than "watch this"