- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how restrict any user from logging remotely ?
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
10-02-2001 04:15 AM
10-02-2001 04:15 AM
how restrict any user from logging remotely ?
On HP-UX V10.20, how can I restrict any user from logging remotely ?
I would like that the only way to connect as this "restriced user" is :
- on the console ;
- by "su" from "non-restricted user".
Thanks
GRP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 04:35 AM
10-02-2001 04:35 AM
Re: how restrict any user from logging remotely ?
you can find information about this in
man hosts.equiv (for rlogin configuration) or
man inetd.sec (for telnet/ftp access).
Another way to configure user access is to use SAM:
sam Areas->Networking and Communication->System Access
Hope this helps
Torsten
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 04:39 AM
10-02-2001 04:39 AM
Re: how restrict any user from logging remotely ?
The way to check if the user is logging in directly is to see the parent process of the shell, it should be another shell and not rlogind or telnetd. I can post my script if you'd like.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 07:04 AM
10-02-2001 07:04 AM
Re: how restrict any user from logging remotely ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 07:05 AM
10-02-2001 07:05 AM
Re: how restrict any user from logging remotely ?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 08:50 AM
10-02-2001 08:50 AM
Re: how restrict any user from logging remotely ?
just touch a file called nologin in /etc. if it exists then it will only allow the following users in.
if [ -r /etc/nologin ]
then
case $LOGNAME in
root ) ;;
bmarkus ) ;;
oracle ) ;;
esac
fi
Good luck
Hope it helps
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 10:09 AM
10-02-2001 10:09 AM
Re: how restrict any user from logging remotely ?
Wouldn't that just effectively prevent anyone from logging in as those users...even an su wouldn't work (?).
Anyway, I've attached my script. I also make the following changes to /etc/profile:
------cut here-----
UID=`id -u`
if [ -f /etc/nologin -a ! $UID = 0 ]
then
echo "Machine not yet available"
exit 0
fi
if [ ! -d ${HOME} ]
then
echo "Unable to change directory to ${HOME}"
exit 1
fi
# Check if in multiuser mode (i.e. runlevel is 3 or 4)
set `/usr/bin/who -r`
RL=$3
set --
if [ $RL = 3 -o $RL = 4 ] && [ `/usr/bin/tty` != /dev/console ]
then
if [ -f /etc/checkuser ];then
. /etc/checkuser
fi
fi
------cut here-----
The script is called checkuser. I create a special group, i.e. su_
Hope this helps.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 11:04 AM
10-02-2001 11:04 AM
Re: how restrict any user from logging remotely ?
on a single line
echo "console" > /etc/securetty
Then only the console will allow direct root logins. All
remote logins must be made with regular accounts
and then they can "su" to root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2001 12:52 PM
10-02-2001 12:52 PM
Re: how restrict any user from logging remotely ?
/etc/profile and /etc/csh.login are not executed for "su loginid", but are executed for "su - loginid". That means that after someone logs in they could "su loginid" regardless of any checks in profile or csh.login. However, to allow "su - loginid" to bypass the edit for being on the console you would need to determine it the user is su'ing. You could do something like:
loginid=`who am i|awk '{print $1}'`
suid=`/usr/bin/whoami`
if [ $loginid = $suid ]
then
#check to see if on console
fi
This works because "whoami" returns the suid while "who am i" returns the loginid. If they are the same the user is probably logging in. If different, they are su'ing.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2001 07:59 AM
10-03-2001 07:59 AM
Re: how restrict any user from logging remotely ?
So I created a group in /etc/group, and this became the access list for who was allowed in.
Then, in /etc/profile, I added a section at the top that 1) determined if they were coming from another network, and if so 2) checked to see if the user was a member of the group.
The script logged them out if 1 was true but 2 was false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2001 08:03 AM
10-03-2001 08:03 AM
Re: how restrict any user from logging remotely ?
Also note that my solution will also prevent someone from logging in from another network, and then su'ing to another user unless that user is also in the access list. This because /etc/profile will run again for the su.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2001 05:33 PM
10-04-2001 05:33 PM
Re: how restrict any user from logging remotely ?
do not forget the other ways of loggin in:
- remote shell: remsh
- secure shell: ssh
- X-Windows/CDE: XDMCP
- NFS remote execution: on
You will have to block those, too.
For "remsh" and "ssh" you may use "/var/adm/inetd.sec",
for "XDMCP" (X Windows Display Manager Protocol) you
can restrict it in "/etc/dt/config/Xsetup", and for the "on"
command in "/etc/inetd.conf".
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2002 08:22 AM
06-05-2002 08:22 AM
Re: how restrict any user from logging remotely ?
Just a word of caution, if you add any script language that uses commands from /usr/bin, like sed, getip, etc. then the script will prevent you from booting in single user mode, since /usr is not mounted when /etc/profile is executed.