Operating System - Linux
1830165 Members
2273 Online
109999 Solutions
New Discussion

Re: hosts.allow and username lookup

 
Sergejs Svitnevs
Honored Contributor

hosts.allow and username lookup

Hi all!
Is it possible to restrict the use of a daemon to a specific user on a specific host?
For example:
allow telnet connection from 10.10.10.1 for user root only.

P.S. /etc/hosts.allow: "in.telnetd: root@10.10.10.1" does not work.

Sergejs
5 REPLIES 5
Claudio Cilloni
Honored Contributor

Re: hosts.allow and username lookup

edit the deamon-specific file in /etc/xinetd.d/,
adding the line 'only_from = ... '.

this lets you to filter specific ip addresses.

regarding the users, I think you should work on the configuration of the specific deamon. xinetd manages only the network connections.

look at man xinetd.conf, man xinetd

Ciao
Claudio
Alexander Chuzhoy
Honored Contributor

Re: hosts.allow and username lookup

perhaps editing /etc/security/access.conf
will help you to solve your problem.
you can specify if a specific user/group can/can't login from specific machine
see the file for examples.
Steven E. Protter
Exalted Contributor

Re: hosts.allow and username lookup

My look at prior threads shows they stop all logins, not for a specific daemon.

As far as root goes, Linux specifically is configured to prevent root telnet login due to the security hazard.

Better off with openssh. Exchange public keys and do the login thing without passwords at all.

Doc attached.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sergejs Svitnevs
Honored Contributor

Re: hosts.allow and username lookup

Alexander,
I have placed in /etc/pam.d/login the following line: account required /lib/security/pam_access.so. Then in /etc/security/access.conf placed:
-:ALL EXCEPT root:10.10.10.1

It doesn`t seems to work.
Anyone out there who has successfully implemented /etc/security/access.conf?

Sergejs
Alexander Chuzhoy
Honored Contributor

Re: hosts.allow and username lookup

sorry,bro
I forgot to mention
you should also add a line in
/etc/pam.d/login
right after the "account" line
it should look like this
account required pam_access.so

do it and it will work