Is there any way to restrict rexec access by user instead of host? I have used TCP wrappers to tighten down network access to the rexec daemon but what I really want is to restrict rexec by user.
Ever thought about eliminating rexec and using ssh access with rsa key authentication? You would then be able to lock the connections down to a user and/or a host.
Thanks for the responses but my environment requires the use of rexec for the time being. The vendor who develops our system has not incorporated SSH into its code. Therefore discovering a way to restrict rexec by user would be the next best step.
I am aware of security best practice but they are simply not applicable here.
As you have probably guessed, I am attempting to tighten rexec access from remote hosts to my User servers. One of my policies is to deny remote logons of the root user via /etc/security/user via the rlogin = false directive. This works great for protocols suchas telnet and rlogin/xlogin but does not work for rexec or rsh. Why is that? Is there anything I can do to restrict root via rexec and still allow my end users to use it?
I am not sure if rhosts is working for me. Even after I enter -<hostname> in the ~/.rhosts it still allows me to use Exceed to rexec from that windows client. It does restrict rsh however. Is this the expected behavior?
I just cant seem to restrict rexec from my Windows exceed clients.
You could (But I wouldn't) put a wrapper round the command, along the lines
if ( uname = "username" -o uname = "another_user" )
then
run command
else
echo "not allowed"
fi
rename / alias rexec call from script
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
Do you mean a wrapper around rexecd? That would mean (i think) that I would alter inetd.conf to look at another file then pass control to rexecd if authorized? Is that correct?
How would you pass control to rexecd? Is rexecd open source? Maybe I can look at the code to see what it expects.
For whoever is interested I ended up doing what mrn suggested. I wrote a Perl script that accepts the rexec compliant string passed to socket TCP/512. The Perl script then scrutinizes the string received by the client for user and execute information. If the calling user is not in a file held in the /etc directory the perl script kills the connection. If the user exists then it passes the unmodified login string to the real rexecd which I configured to listen on a different port. Since the remote rexec request has DISPLAY information included, the real rexecd does not care where the request comes from but simply check the password and executes the command if allowed.
After about 2 weeks in a development environment it seems to work well. I believe this to be an acceptable solution for environments that *must* have rexec service available.
You may have already done this, but you should tighten down your tcpwrapper on rexecd to only accept connections from localhost. Otherwise all an unauthorized user needs to do to bypass your program is find out what the new rexecd port is.
- Rod
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
Don't know why I replied to this again. One of those days......
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
Abubasim, I thank you. Your solution is the simplest and best for what I want to do. Using the /etc/security/user file I can deny rexec by user by simply listing the !REXEC in the tty= directive of the user's stanza. Now that is tidy!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.