LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 08-28-2009, 11:03 AM   #1
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 9.04
Posts: 119
Thanked: 0
Pam immediatly closes sftp session for jailed users, but not for scp


[Log in to get rid of this advertisement]
I'm running a student server in which all students are jailed in their respective folders.

Login in using scp gives no issues, except for when they try loging in with sftp.

I checked the logs, and it looks like sftp does it's job. The connection is established, credentials are checked, they are jailed into their folder. But then all of a sudden, pam closes the connection immediately with a session:closed entry.

Quote:
Aug 28 17:02:04 eduserv sshd[20432]: Accepted password for cfk from xx.xxx.xxx.xx port 64163 ssh2
Aug 28 17:02:04 eduserv sshd[20432]: pam_unix(sshd:session): session opened for user cfk by (uid=0)
Aug 28 17:02:04 eduserv sshd[20439]: subsystem request for sftp
Aug 28 17:02:04 eduserv jk_chrootsh[20440]: now entering jail /home/jail for user cfk (1000)
Aug 28 17:02:04 eduserv sshd[20432]: pam_unix(sshd:session): session closed for user cfk
Loging in with scp gives no such problem.
linuxubuntu Carroarmato0 is offline  
Tag This Post ,
Reply With Quote
Old 08-28-2009, 12:11 PM   #2
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 9.04
Posts: 119
Thanked: 0

Original Poster
I found out, that changing the Subsystem to use the internal-sftp works, however, using this doesn't jails the users.
linuxubuntu Carroarmato0 is offline     Reply With Quote
Old 08-28-2009, 03:15 PM   #3
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 9.04
Posts: 119
Thanked: 0

Original Poster
Tried playing around with the Match directives in sshd... but those don't seem to work one tiny bit.
linuxubuntu Carroarmato0 is offline     Reply With Quote
Old 09-15-2009, 09:21 AM   #4
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 9.04
Posts: 119
Thanked: 0

Original Poster
I have solved my problem. When a user wants to login in his jail through sftp, ssh authenticates the user, and then call the sftp-server subsystem.

This subsystem needs writing access to the /dev/null device in the jail. After setting that, sftp works like a charm.
linux Carroarmato0 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh LXer Syndicated Linux News 0 01-02-2008 01:40 PM
LXer: How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh LXer Syndicated Linux News 0 01-02-2008 01:00 PM
LXer: How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh LXer Syndicated Linux News 0 01-02-2008 11:00 AM
X Session shutdown immediatly !! bart59 Mandriva 2 06-26-2004 01:05 AM
ls command closes sftp connection SpecialK5106 Linux - Networking 4 11-03-2003 03:18 AM


All times are GMT -5. The time now is 01:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration