LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-16-2006, 11:41 PM   #1
erat123
Member
 
Registered: Oct 2006
Distribution: Ubuntu
Posts: 69

Rep: Reputation: 16
SSH Virtual Hosting


Currently, I have my web server (www.integratedwebs.com) configured to host multiple domain names on the one static ip address. I configured it to use SCP to connect (windows users use WinSCP to edit their files).

I'm not sure of a good way to explain what I would like to do, so, here's my attempt:

registered people at integratedwebs.com:
eric
tom
bill
sue

registered people at mydomain.com
fred
tom
gary

both domains are on my server, i would like them to be able to type in their domain name, and their user name and log in. but, you'll notice tom is on both domains. is there a way to create a second passwd file? or some way to allow one login to go to one place, and the other to go to another place?

thanks in advance!
Eric
 
Old 11-17-2006, 02:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ssh doesn't use domain names in it's protocols, all it does is resolve to an ip address on the client and then connect away. the connection that is recieved by the server will be identical whatever domain name is connected to, so there's nothing to get hold of. only thing i'd think of is listening with a seperate SSH server listening on a different port, but that depends what a "place" is... a directory? a server?
 
Old 11-17-2006, 09:42 AM   #3
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
If you follow the "separate sshd" route, you'd have to instruct (e.g.) people at mydomain to "ssh -p 2201", "scp -P 2201" etc. Maybe move integratedwebs to port 2200, for symmetry.

But sshd will still look up people in /etc/passwd, and I can't find an option in sshd_config to override that. You can only have one "tom" user on your machine / in your password file. You may have to chroot each sshd. That might not be so bad; if they ssh in, they can at most see their own virtual site's stuff.

If that sounds heavy-handed, the lightweight alternative would be to include the domain in the user name (check how long they can be on your system). It would look a bit silly for your users, because they'd have to type, e.g.,
Code:
scp new-and-improved/index.html tom_mydomain@mydomain.com:
But hey, whether it's the port or the user name, they can stuff it into their ~/.ssh/config, e.g., like this
Code:
Host mydomain
    HostName mydomain.com
    # either
    Port 2201
    # or
    User tom_mydomain
And then simply "scp X Y Z mydomain:"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting bstuart Linux - Software 1 06-19-2005 11:26 AM
Virtual Hosting? nr5 Linux - Software 10 06-03-2005 01:30 PM
virtual hosting setenv02 Linux - General 6 05-05-2005 02:35 AM
Virtual Hosting Thom_Redhat Fedora 0 01-14-2005 07:26 AM
Virtual hosting... id10t Linux - Networking 4 02-02-2004 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration