- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- validate username with ip
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
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
04-13-2005 05:09 AM
04-13-2005 05:09 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2005 05:12 AM
04-13-2005 05:12 AM
Re: validate username with ip
You can NOT validate the person who is using userid: jsmith as the real jsmith - unless you are using sophisticated logins with say finger printing or retinal scans.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2005 05:23 AM
04-13-2005 05:23 AM
Re: validate username with ip
who -u will give you ip addresses from where users have logged in. (You may also want to use getip command to check there ip address)
(Or you may have list with you already)
Also you can prepare a user list from /etc/passwd or with logins -u command.
Now you have ip address and user name. Not put a code in /etc/profile to check username and check if it is coming from a particular ip. If allow access, else do what you want-log them out, send message, whatever
Something like follows.
usr_id=@(whoami)
ip_address=$(getip "$(who -um|awk '{print $NF}'|awk -F : '{print $1}')")
fix_ip=$(grep -q ${user_id} /var/adm/file|awk '{print $2}')
#/var/adm/file will have details about userid and their ip addresses. Like follows.
# xxx 10.9.12.20
#Second awk is required to take care of CDE, Exceed, Reflection logins)
if [[ ${user_id} -eq ${user_id} && ${ip_address != ${fix_ip} ]]
then
echo "Access not allowed"
exit
fi
### Script not tested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2005 05:32 AM
04-13-2005 05:32 AM
Re: validate username with ip
Trying to workaround behavioral problems like this means that users will still try to get around the system no matter what. It's a symptom of non-support for your security policies. Your systems are safe when everyone takes all the policies seriously.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2005 05:35 AM