Could do with some help with a debian server (sftp)

Zoopy

New member
Joined
Jul 10, 2012
Messages
1
Hi

Ive been trying to get a "user" setup for a friend, basically so he could enter IP address of server and it would come up with the directory structure of a certain directory but my attempts so far have failed.....

This server is bought and I have a user that was setup via a template lets call it "me" I can log in via internet explorer via ftp://192.168.0.0 (fake ip for security) and it will ask for my login and pass and off it goes no problem, but when I try the user I set up it just bounces back to the login prompt, but it can log in via filezilla for example.

I must admit now that my use of this is very limited so walk through would be very appreciated :)

What ive one so far

Edited sshd_config with :-

Code:
subsystem sftp internal-sftp (#ing the original line)

adding at the bottom :-
Code:
Match group sftponly
[INDENT]ChrootDirectory /home/%u[/INDENT]
[INDENT]ForceCommand internal-sftp[/INDENT]
[INDENT]X11Forwarding no[/INDENT]
[INDENT]AllowTcpForwarding no[/INDENT]

Restarted the ssh server

Added the group sftponly

added user with

Code:
useradd -m username

Added user to sftp group with

Code:
usermod -g sftponly username

removed the shell access

Code:
usermod -s /bin/false username

Changed ownership

Code:
chown root:root /home/username

Created a fake home dir

Code:
mkdir -p /home/username/home/username

Switched user ownership

Code:
chown username:username /home/username/home/username

and then mouted a directory inside the usernames home direcory

Code:
mount -o bind /some/directory/ /home/username/home/username/new directory

Is there anything else I need to do to make this work or will it not work at all?

Cheers
 
Back
Top