- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: prventing telnet in for all user except root a...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:17 PM
01-24-2006 07:17 PM
I need to enhance system security and that is why I am going to prevent all users except root, user1, user2 from telnet in the system from anywhere any pc. How can I do that?
Rgds,
Rana
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:19 PM
01-24-2006 07:19 PM
Re: prventing telnet in for all user except root and user1, user2
Do you have access to /etc/passwd file ? if yes, you can edit all user's shell to "/bin/false" except root, user1 and user2.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:22 PM
01-24-2006 07:22 PM
Re: prventing telnet in for all user except root and user1, user2
if [ ${LOGNAME} != "root" -o ${LOGNAME} != "user1" -o ${LOGNAME} != "user2" ]];then
echo "No direct telnet allowd"
exi1
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:26 PM
01-24-2006 07:26 PM
Re: prventing telnet in for all user except root and user1, user2
You can do it with /etc/profile scripting as,
if [[ ${LOGNAME} = "root" || ${LOGNAME} = "user1" | ${LOGNAME} = "user2" ]]
then
ps | grep -q 'telnet'
if [[ $? -eq 0 ]]
then
echo "Telnet access to user ${LOGNAME} is denied. Contact @ information"
sleep 2
fi
fi
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:27 PM
01-24-2006 07:27 PM
Re: prventing telnet in for all user except root and user1, user2
directly an answer:
put a filter in /etc/profile (supposing your user have a login shell)
like
if [ tty -s ]
then
cmd=exit
if [ $user = root ] ; then cmd=true ; fi
if [ $user = user1 ] ; then cmd=true ; fi
...
fi
$cmd
(tty -s will run filter only on terminal session)
not directly an answer:
but if you are concerned about security, you shouldn't use telnet at first.
at least use ssh.
using ssh, you can control which user can access system through public/private key.
Jean-Yves
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:27 PM
01-24-2006 07:27 PM
Re: prventing telnet in for all user except root and user1, user2
Do not adopt the first response, it will not allow your user to login by any means not only telnet. Even rlogin,ssh,console login too will not work for all other users.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:28 PM
01-24-2006 07:28 PM
Re: prventing telnet in for all user except root and user1, user2
Hope we have to check the telnet login with ps | grep 'telnet' to exclude other service logings like ssh, rlogin.
Rana,
You can as well use tcp wrappers to control user based.
Note: /etc/profile is used to control terminal based logins. Not GUI based. For GUI based you have to turn on dtprofile to lookup /etc/profile file too.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:29 PM
01-24-2006 07:29 PM
Re: prventing telnet in for all user except root and user1, user2
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=543133
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=469590
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:32 PM
01-24-2006 07:32 PM
Re: prventing telnet in for all user except root and user1, user2
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=TCPWRAP
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B6849AA
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:34 PM
01-24-2006 07:34 PM
Re: prventing telnet in for all user except root and user1, user2
if [[ ${LOGNAME} = "root" || ${LOGNAME} = "user1" | ${LOGNAME} = "user2" ]]
then
ps | grep -q 'telnet'
if [[ $? -eq 0 ]]
then
echo "Telnet access to user ${LOGNAME} is denied. Contact @ information"
sleep 2
exit 1
fi
fi
That is important. After lunch, everything is working in 0 kms.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:36 PM
01-24-2006 07:36 PM
Re: prventing telnet in for all user except root and user1, user2
if [[ ${LOGNAME} != "root" || ${LOGNAME} != "user1" | ${LOGNAME} != "user2" ]]
then
ps | grep -q 'telnet'
if [[ $? -eq 0 ]]
then
echo "Telnet access to user ${LOGNAME} is denied. Contact @ information"
sleep 2
exit 1
fi
fi
Forget to do negative check. :(
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 08:38 PM
01-24-2006 08:38 PM
Re: prventing telnet in for all user except root and user1, user2
Thanks. Since it is a security concern, If I want to use ssh instead of telnet with strong security like previously specified then whatelse should I need.
Rgds,
Mostafa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 08:40 PM
01-24-2006 08:40 PM
Re: prventing telnet in for all user except root and user1, user2
You need to install and configure Secure shell, which can be downloaded from,
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
And, put the code snippet from Muthukumar in /etc/profile,
------
if [[ ${LOGNAME} != "root" || ${LOGNAME} != "user1" | ${LOGNAME} != "user2" ]]
then
ps | grep -q 'telnet'
if [[ $? -eq 0 ]]
then
echo "Telnet access to user ${LOGNAME} is denied. Contact @ information"
sleep 2
exit 1
fi
fi
---
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 08:40 PM
01-24-2006 08:40 PM
Solutionps | grep -q 'telnet'
to
ps | grep -q 'ssh'
For rlogin denial,
ps | grep -q 'rlogind'
in that script.
If you want to block telnet, ssh then,
ps | grep -Eq 'telnet|ssh'
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 09:16 PM
01-24-2006 09:16 PM