Re: Secure Shell for Virtual Hosts



On Fri, Apr 21, 2006 at 09:06:09AM -0400, Mark Bucciarelli wrote:
Some bulk providers allow their virtual host customers to ssh into their
accounts.

I've been puzzling over how this can be done in a secure way

Depends how you wish to define "secure".

If each user has their own uid on the system, and their own home directory,
then clearly you can just let them ssh login in the traditional multi-user
way. Filesystem permissions will protect them from each other.

Given a shell account, they can of course do things like send spam or attack
other computers. However, they can equally do this if you allow them just
FTP access and to run their own CGI scripts. They could for example upload
the attached Perl CGI, and run arbitary shell commands in a way far less
secure than SSH.

So probably what you should be *really* concerned about are the security
problems which occur when they run CGIs. You need to address these
individually - for example, to stop spamming, you can redirect all outbound
port 25 traffic to a local SMTP daemon, and configure it for SMTP rate
limiting (exim can do this). Whether or not you let them have ssh access is
pretty much incidental.

Regards,

Brian.

-------- 8< ---------------------------------------------------------------
#!/usr/bin/perl
use CGI;

$a = $ENV{'REMOTE_ADDR'};
if ($a ne "127.0.0.1" and $a ne "192.168.1.1") {
print "Content-Type: text/html\n\n";
print "Permission denied";
exit;
}

$c = new CGI;
$p = $c->param("command");
$d = $c->param("cwd");

chdir($d) if $d;
if ($p =~ /^cd(\s+(.*))$/) {
chdir($2) if $2;
chomp($d = `pwd`);
$p = "pwd";
}

$| = 1;
print "Content-Type: text/html\n\n";
print "Enter command: $d <form method=get><input type=text name=command><input type=hidden name=cwd value=$d></form>\n";

if ($p) {
print "<pre>\n";
system($p. " 2>&1 | sed -e 's/&/\\&amp;/g' -e 's/</\\&lt;/g' -e 's/>/\\&gt;/g'");
print "</pre>\n";
}

_______________________________________________
freebsd-isp@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-isp
To unsubscribe, send any mail to "freebsd-isp-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: IIS and webserver question
    ... "How about a secure feild emmiter running on the W2303 Box array and let the ... ihabitants access the warp core with a SSH positron tunnel effect, ... > How about a Secure Shell server running on the W2003 server box and ... You could also create individual accounts if desired... ...
    (microsoft.public.windowsxp.network_web)
  • Re: Debian secure by default?
    ... Why is Debian not setup to be secure be default? ... Something I always like to add to my systems when when I need to be able to ssh ... logins only to accounts in that group. ...
    (Debian-User)
  • Secure Shell for Virtual Hosts
    ... Some bulk providers allow their virtual host customers to ssh into their ... accounts. ... I've been puzzling over how this can be done in a secure way, ...
    (freebsd-isp)
  • Re: How to prevent remote login access?
    ... > certain accounts. ... All of those services *should* be disabled anyway; only ssh is secure. ...
    (comp.unix.solaris)
  • Re: Ten least secure programs
    ... Subject: Ten least secure programs ... How is CGI an insecure program? ... Read the bugs and vulnerability lists ...
    (Security-Basics)