LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-29-2013, 03:33 AM   #1
Damnedkrt
LQ Newbie
 
Registered: Oct 2011
Posts: 8

Rep: Reputation: Disabled
I lose SSH access when setting up SFTP


Hi!

I've been fooling around with SFTP. I can get it up and running, but whenever I do so, I can't nog longer log in with SSH with my user.
SFTP is set up for another user that should have SFTP access only.

Basicly, I just wanna share a few files with a friend - but not letting this friend be able to access anything else on my server.

I've read the thousand different SFTP-guides that are out there, so I'm guessing I'm making a pretty easy configuration error.

This is my sshd_config:

Code:
# -- Chrooted sftp server options
#Subsystem sftp internal-sftp
#Match Group sftpusers sftpuser
#ChrootDirectory /home/%u
#ForceCommand internal-sftp
#AllowTcpForwarding No
#X11Forwarding no

#AllowGroups sftpusers sftpuser myuser
Could someone please tell what is shutting my user out?
 
Old 07-29-2013, 07:14 AM   #2
tombelcher7
Member
 
Registered: Feb 2008
Location: Surrey
Distribution: Debian
Posts: 214

Rep: Reputation: 5
As SFTP runs as a subsystem of SSH it runs on whatever port the SSH daemon is listening on and that is administrator configurable.

http://serverfault.com/questions/741...-does-sftp-use

It sounds like it shouldn't interfere but it does.

What do you get if you telnet port 22 on this host? Does it tell you what service is listening on it?
 
Old 07-29-2013, 07:53 AM   #3
Damnedkrt
LQ Newbie
 
Registered: Oct 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tombelcher7 View Post
As SFTP runs as a subsystem of SSH it runs on whatever port the SSH daemon is listening on and that is administrator configurable.

http://serverfault.com/questions/741...-does-sftp-use

It sounds like it shouldn't interfere but it does.

What do you get if you telnet port 22 on this host? Does it tell you what service is listening on it?
I could try telnet, but I'd rather not, since this is a headless machine it is a pain to undo those changes.

I have ssh on port 2225 - which is the port I connect with SFTP with as well.
 
Old 07-29-2013, 11:05 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I used this:
Code:
Match User <user>         
        ChrootDirectory /home/<user>
        ForceCommand internal-sftp
        AllowTcpForwarding no
match Group seemed to not work as intended.

See - josircg's answer

Last edited by Habitual; 07-29-2013 at 11:06 AM.
 
Old 07-30-2013, 06:47 AM   #5
tombelcher7
Member
 
Registered: Feb 2008
Location: Surrey
Distribution: Debian
Posts: 214

Rep: Reputation: 5
Hello,

I think my suggestion was misunderstood; what I meant was to use a telnet client from a separate host to query the port on your server machine;(typically it gives you information regarding the service that is listening on the port).

Otherwise use NMAP from another host failing this.

Quote:
Originally Posted by Damnedkrt View Post
I could try telnet, but I'd rather not, since this is a headless machine it is a pain to undo those changes.

I have ssh on port 2225 - which is the port I connect with SFTP with as well.
 
Old 07-30-2013, 07:00 AM   #6
Damnedkrt
LQ Newbie
 
Registered: Oct 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tombelcher7 View Post
Hello,

I think my suggestion was misunderstood; what I meant was to use a telnet client from a separate host to query the port on your server machine;(typically it gives you information regarding the service that is listening on the port).

Otherwise use NMAP from another host failing this.
What I meant was, when I uncomment those lines in my sshd_config - I lose SSH. And the server is a headless one - so I have to connect keyboard and monitor in order to undo the changes in sshd_config... I'm not really a fan of physical excercise

I'm familiar with NMAP, I'll give it a try and get back with the result.
But then I guess telnet isn't the most advanced application in the world either I've just never bothered to learn it.
 
  


Reply



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
ssh / sftp umask setting tiedyeguy64 Linux - Software 1 06-15-2012 04:56 AM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 07:10 AM
sFTP without SSH access acmeinc Linux - Server 3 03-17-2009 02:35 PM
Need help configuring permissions to allow FTP access via SSH/SFTP. dhupke Linux - General 5 06-12-2007 12:26 PM
setting up remote or sftp access helpme0904 Linux - Newbie 2 08-02-2005 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration