Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What I'm trying to do is set up a SSH key that only gives access to certain directories, for security reasons I don't want it to have full access to my SSH server. I already have the ability to access the directories I need over my local network (right now using SMB, although I also used UPnP for awhile). I need, however, to be able to access those files securely over the internet from both Ubuntu and Windows machines.
I'm somewhat new to SSH and not sure what the best approach to solving my problem is. If anyone knows how I can do this or where I can find a detailed tutorial I'd be grateful.

And as always if anything is confusing or if there are any comments or corrections please let me know.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

My suggestion would be Change Root using ssh. This is a new feature of the OpenSSH server since version 4.8p1. (ubuntu package: openssh-server) and hence available on the newer ubuntu releases.

In a nutshell, if a certain user (for which you would distribute the key) logs in via ssh, he/she will be jailed inside a named directory making access to anything that's outside of that inaccessible. This is particularly straightforward to set up if you only want access to files and not really run any programs for the chrooted user. See for instance here: http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny

If you can elaborate on the specific needs that you have we can maybe comment more.

Also, once you have your jailed ssh user configured, you might want to consider sshfs (for ubuntu) and netdrive - http://www.netdrive.net (for windows) to seamlessly mount these directories on the respective machines.

share|improve this answer
    
this looks great thanks for the help. –  Michael Chapman Feb 19 '11 at 23:43
    
little caveat: while I use, like and recommend sshfs, I have not tried netdrive - so this came from a google search –  DrSAR Feb 20 '11 at 5:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.