Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] SFTP Jailroot Write Access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tux12Fun
Apprentice
Apprentice


Joined: 16 Aug 2007
Posts: 156

PostPosted: Mon Oct 04, 2010 6:18 pm    Post subject: [SOLVED] SFTP Jailroot Write Access Reply with quote

Hi,

I got the following problem. In our company we have a very old SFTP Server. My new task is to replace this SFTP Server,
with a new one and keep the Directory Structures and Logins.

The old one is Build as the following
/exchange/home/it/user1 << Exchange Directory (owned by User and Group IT)
/home/exchange/.ssh << Authorized Keys and Stuff

So I tied the following SSH Conf
Code:

Protocol 2
AuthorizedKeysFile      .ssh/authorized_keys
PasswordAuthentication no
UsePAM yes
X11Forwarding yes

UsePrivilegeSeparation no

Subsystem      sftp    internal-sftp

AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL


Match Group it
        ChrootDirectory           /exchange/home/it/%u
        AllowTCPForwarding      no
        X11Forwarding             no


I have read that all Directorys have to be owned by root and the group isn't allowd to write in the Directorys.

But is there a possibility that user1 can write directly to his jailed root dir ?
Or is there a possibility to set the initial login directory. Then I could create a Directory Structure like this
/exchange/home/it/user1/rw/
and set the Login Dir to rw/

The User shouldn't see a difference between the old server an the new one.

Thank you for your Hints.


Last edited by Tux12Fun on Mon Oct 04, 2010 8:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tux12Fun
Apprentice
Apprentice


Joined: 16 Aug 2007
Posts: 156

PostPosted: Mon Oct 04, 2010 8:32 pm    Post subject: Reply with quote

I found a way that works for me.

If you add a user. You can modify /etc/passwd.

Set the Homepath to the Home in the Chroot realtiv.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum