Default login folder for domain


#1

I have mydomain.com hosted on DreamHost.

I can ssh/ftp/sftp to mydomain.com no problem.

But the default directory I’m logged into is my user directory, not the mydomain.com directory.

So, I always have to cd into domain.com, or provide it as my initial path in my FTP client, etc.

Is there any way to make it smart enough so that if I log into mydomain.com instead of server.dreamhost.com, it realizes I’m trying to administer a particular domain, and not my entire user account?


#2

You’re logging in as a user, not a domain, so it puts you in the user’s directory. My FTP client allows me to pick a remote directory as my default, so I automatically end up in mydomain.com

-Scott


#3

Right. I realize I can enter an initial path in my FTP client to get to the mydomain.com directory. I’m wondering if there’s a way around that.

What I’m expecting is that based on the fact that I’m logging into mydomain.com instead of server.dreamhost.com, I should automatically end up in the mydomain.com directory. I mean, it makes sense, doesn’t it?


#4

It’d be nice if it made sense, but it won’t. In Apache, a browser tells it what domain it’s asking for. In FTP, the client doesn’t tell the server what domain it’s asking for - just the username.

-Scott


#5

Yeah, oh well. Thanks for your help.


#6

I don’t know of any way to differentiate between logging into the server vs your domain, but for SSH you can add:
cd domain.com
to your .bash_profile file. This way when ever you log into SSH with that user, you’ll automatically be put into your domain directory. if you need you’re home directory, just “cd …”. I don’t know any way to set this for FTP though.

–Matttail
art.googlies.net - personal website


#7

While this would work for the one domain, I believe the original poster has multiple domains and wanted a situation where SSH would automatically CD to the correct domain directory, depending on the domain (hostname) he used for the log-in. Of-course, they could expand apon your suggestion by creating a unique user to control each domain then modifying each users bash profile.

As for FTP; I think this is probably the easiest to configure, but it will need to be done at the client, not the server. Simply create as many site log-ins as required, in the clients site manager, and configure each with a different remote path.

Overall, I think it is all more hassle than it is worth. :slight_smile:

Mark


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )