Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Aug 21, 2011 2:08 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
If I wanted to host a website for a friend, how should I go about this?

If he were to have access via something like FTP, perhaps like a regular web host, how should I do this?

Should I create a new user on my linode and have the user's home directory be where they host their site? Connecting via FTP?

I'm new to linode and am running Ubuntu 10.04 LTS.


Top
   
PostPosted: Sun Aug 21, 2011 2:26 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
groffcole wrote:
Should I create a new user on my linode and have the user's home directory be where they host their site?

Yes, that's exactly what you should do.

groffcole wrote:
Connecting via FTP?

You could do that with proftpd or vsftpd, but FTP is generally considered insecure because the username and password are transmitted in plain text. Instead, give your friend an SSH account that is jailed to his/her home directory. (Google for "ssh jail home directory".) SSH includes SFTP, which is much more secure than FTP and your friend can use it just like good old FTP .


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 2:38 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
That makes sense. Most FTP clients allow connecting via SFTP...

And, before looking at this SSH jail stuff, I'm assuming this means that the user won't be able to go exploring around the system? It locks, or "jails," them to their home directory?


Thanks!


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 2:41 am 
Offline
Linode Staff

Joined: Fri Feb 18, 2011 10:08 am
Posts: 42
Location: Galloway, NJ
Yes, we have a tutorial if you need a starting point as well-
http://library.linode.com/security/sftp-jails


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 2:46 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
Thank you. The google search lead me right there.

A couple other questions:
1) Is there a way to allow the user to set their own password?
2) Is there any software that would allow a user some sort of web interface for this sort of thing?


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 2:58 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
This seems to have made it so I cannot login on the account I put in the sudoers file. And I also cannot login via sftp with the account I setup for sftp.

Hrmm.... now I cannot login to my linode.

Edit:
More info:
I have root ssh access turned off, I've turned of password authentication to use SSH keys instead. My user account, that I created and added to the sudoers file, is unable to login via a terminal at the moment. Also, I can't seem to login with the account I made for my friend (via sftp).

Is there something I did incorrect? I followed the Linode guide.


Thanks.


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 3:27 am 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:11 pm
Posts: 142
It sounds like all users were added to the jailed sftp-group ('filetransfer' in the guide) instead of just the intended user (or something to that effect)

Can you login via lish?


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 9:02 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
Yes, I can login via lish.


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 9:42 am 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:11 pm
Posts: 142
Could you post your /etc/ssh/sshd_config file, please?


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 11:23 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
sshd_config:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO


# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
PasswordAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp internal-sftp

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM ye


#Match group filetransfer
# ChrootDirectory %h
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand internal-sftp


Also, I seem to be having an issue restarting my ssh via /etc/init.d/ssh restart. This is the output when I run that command:

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart ssh
ssh start/running, process 15959


When I run service ssh restart, I get this:
restart: Unknown instance:


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 11:25 am 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
Also, connecting via ssh and the mac terminal, I get this:
ssh: connect to host colegroff.com port 22: Connection refused


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 7:25 pm 
Offline
Senior Newbie

Joined: Wed Aug 17, 2011 2:07 am
Posts: 12
I am now able to login via ssh and my terminal. I somehow screwed up a part of the sshd_config file:
"UsePAM ye "

This section said "ye" instead of "yes". So now I can login all right. I'm going to checkout the other issues later tonight.


Top
   
 Post subject:
PostPosted: Mon Aug 22, 2011 4:15 am 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
groffcole wrote:
Thank you. The google search lead me right there.

A couple other questions:
1) Is there a way to allow the user to set their own password?
2) Is there any software that would allow a user some sort of web interface for this sort of thing?


Have a look at virtualmin GPL as I believe it may be what you're looking for and is free.

FWIW I'm running it and it works great on linode.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group