LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-28-2009, 10:03 AM   #1
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Rep: Reputation: 15
Pam immediatly closes sftp session for jailed users, but not for scp


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.
 
Old 08-28-2009, 11:11 AM   #2
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
I found out, that changing the Subsystem to use the internal-sftp works, however, using this doesn't jails the users.
 
Old 08-28-2009, 02:15 PM   #3
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
Tried playing around with the Match directives in sshd... but those don't seem to work one tiny bit.
 
Old 09-15-2009, 08:21 AM   #4
Carroarmato0
Member
 
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Original Poster
Rep: Reputation: 15
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.
 
  


Reply

Tags
pam, sftp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12: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 12: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 10:00 AM
X Session shutdown immediatly !! bart59 Mandriva 2 06-26-2004 12:05 AM
ls command closes sftp connection SpecialK5106 Linux - Networking 4 11-03-2003 02:18 AM


All times are GMT -5. The time now is 05:59 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration