Hello, folks--
I recently opened a virtual private server account w/ FreeBSD 7.2
for my Web site(s). I'm a long-time Linux user and have occasion-
ally interacted as a user with other *nix systems, including FreeBSD, but this is my first time administering a BSD system.
Anyway, I would like to control SSH login privileges in the following way:
1) Allow public key authentication for myself from anywhere.
I may add a few other users in the future, but it should
be few enough that I can easily list them in an AllowUsers
rule.
2) Allow password/keyboard-interactive login for myself from
home (in case of emergency) and from my workplace (because
I have no way to secure a private key at work).
3) Deny all other logins.
BTW, if it's not obvious, "myself" means myself under my regular
user name. I don't see a need to allow remotely logging in as
root.
So I have the following in /etc/ssh/sshd_conf:
(that's a made-up username representing myself)
That seems to accomplish (1) above.
It appears that I can accomplish (2) with the following entry in
/etc/login.access:
(where the first IP is my single static IP at home, and
the second is the subnet at work)
Have I got that right?
Also: does /etc/login.access have any effect on su access once I am logged in remotely? If so, how do I ensure that I can su as needed?
Finally, I had a look at the authentication logs the other day,
and saw a buttload of access attempts from various locations--
a little bit worrisome. I'm thinking it might be a good idea to
have some additional protection against those whoever-they-ares.
I have heard of a Perl script called SSHBlack--can anyone comment on its safety & effectiveness? Even better, is there a Python equivalent--since I know Python well, but not Perl.
Any important questions that I haven't asked, but should?
Thanks for any tips.
I recently opened a virtual private server account w/ FreeBSD 7.2
for my Web site(s). I'm a long-time Linux user and have occasion-
ally interacted as a user with other *nix systems, including FreeBSD, but this is my first time administering a BSD system.
Anyway, I would like to control SSH login privileges in the following way:
1) Allow public key authentication for myself from anywhere.
I may add a few other users in the future, but it should
be few enough that I can easily list them in an AllowUsers
rule.
2) Allow password/keyboard-interactive login for myself from
home (in case of emergency) and from my workplace (because
I have no way to secure a private key at work).
3) Deny all other logins.
BTW, if it's not obvious, "myself" means myself under my regular
user name. I don't see a need to allow remotely logging in as
root.
So I have the following in /etc/ssh/sshd_conf:
Code:
AllowUsers gomez
That seems to accomplish (1) above.
It appears that I can accomplish (2) with the following entry in
/etc/login.access:
Code:
-:ALL EXCEPT: gomez@88.54.129.20/32 gomez@211.41.0.0/16
(where the first IP is my single static IP at home, and
the second is the subnet at work)
Have I got that right?
Also: does /etc/login.access have any effect on su access once I am logged in remotely? If so, how do I ensure that I can su as needed?
Finally, I had a look at the authentication logs the other day,
and saw a buttload of access attempts from various locations--
a little bit worrisome. I'm thinking it might be a good idea to
have some additional protection against those whoever-they-ares.
I have heard of a Perl script called SSHBlack--can anyone comment on its safety & effectiveness? Even better, is there a Python equivalent--since I know Python well, but not Perl.
Any important questions that I haven't asked, but should?
Thanks for any tips.