Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am looking for a way to secure my servers with the following setup: I have a server where I can log in via SSH. The main account there (named "foo") is secured by a keybased login with password. I have another user account (named "bar") that I use to log in via cronjobs running on other servers - this one also has keybased login, but without password.

Now I want to limit access to this machine for the "bar" account. The account should only be accessible via known IPs. However, the "foo" account should not be affected by this, this one should basically be accessible from any IP.

How can I manage this? Or is there a simpler solution to everything?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Manage this with ssh's AllowUsers directive. In /etc/ssh/sshd_config:

AllowUsers foo bar@hostname

Put the IP and hostname of bar's machine in /etc/hosts on the ssh server (because DNS might be unreachable and the IP might change), restart ssh, and you're all set.

share|improve this answer
    
Thanks, will give this a try! –  j0nes Dec 27 '10 at 22:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.