LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-06-2013, 04:41 PM   #1
earwaxntoast
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Rep: Reputation: Disabled
Exclamation error: subsystem: cannot stat /usr/libexec/openssh/sftp-server


I have a RHEL 6.3 box running OpenSSH 5.3.
The box is set up as an SFTP server. I am using keypair and password authentication. When I attempt a connection, I always get the following error in /var/log/secure:

error: subsystem: cannot stat /usr/libexec/openssh/sftp-server: No such file or directory

I have verified that the file exists, and is executable by everyone.

I've also attempted moving the file to another location and updating my sshd_config file, and still got the error, but with the updated path.

I have updated OpenSSH to v5.3, and I'm still getting the same error.

When I attempt to connect from another linux box using the sftp command, I get the following error:
subsystem request failed on channel 0
Couldn't read packet: Connection reset by peer

However, if I attempt to connect using either Filezilla, or putty's psftp software, the connection is successful and I'm able to use the sftp server.

The file not found error on the subsystem file still occurs in the secure log, however.

Unfortunately, I can't just suggest another client in this case, since our client needs to script out automatic loads of a file via the command line sftp client.

I've searched google for hours and can only find folks who haven't verified file location, which was the first thing I checked.

Any assistance or guidance is very much appreciated!

Last edited by earwaxntoast; 03-06-2013 at 04:44 PM.
 
Old 03-06-2013, 04:45 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
What is the output of the following on the file?

Code:
lsattr
stat
ls -alZ

Also, is selinux enabled?
 
Old 03-06-2013, 04:53 PM   #3
earwaxntoast
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for taking the time to reply.

Here's the result of your commands. I also threw in a locate since it was the last thing I did before your stuff:
Code:
[root@pvm269 openssh]# locate sftp-server
/usr/libexec/openssh/sftp-server
/usr/share/man/man8/sftp-server.8.gz
[root@pvm269 openssh]# lsattr
-------------e- ./ssh-keycat
-------------e- ./sftp-server
-------------e- ./ssh-keysign
[root@pvm269 openssh]# stat
stat: missing operand
Try `stat --help' for more information.
[root@pvm269 openssh]# ls -alZ
drwxr-xr-x. root root unconfined_u:object_r:usr_t:s0   .
drwxr-xr-x. root root system_u:object_r:usr_t:s0       ..
-rwxr-xr-x. root root unconfined_u:object_r:usr_t:s0   sftp-server
-rwxr-xr-x. root root unconfined_u:object_r:usr_t:s0   ssh-keycat
-rwxr-xr-x. root root unconfined_u:object_r:usr_t:s0   ssh-keysign
[root@pvm269 openssh]#
selinux is enabled:

Code:
[root@pvm269 openssh]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          permissive
Policy version:                 24
Policy from config file:        targeted
[root@pvm269 regentadmin]#
 
Old 03-06-2013, 04:57 PM   #4
earwaxntoast
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
sorry, missed the stat:

Code:
[root@pvm269 openssh]# stat sftp-server
  File: `sftp-server'
  Size: 63544           Blocks: 128        IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 787314      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-03-06 17:16:51.272038846 -0500
Modify: 2013-03-06 17:16:51.273039770 -0500
Change: 2013-03-06 17:16:51.273039770 -0500
 
Old 03-06-2013, 07:00 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Hmmm; given you've got SELinux as Permissive (risky) it shouldn't affect things, but FYI on my Centos 6.3
Code:
 ls -alZ
drwxr-xr-x. root root system_u:object_r:bin_t:s0       .
drwxr-xr-x. root root system_u:object_r:bin_t:s0       ..
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       gnome-ssh-askpass
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       sftp-server
lrwxrwxrwx. root root system_u:object_r:bin_t:s0       ssh-askpass -> gnome-ssh-askpass
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       ssh-keycat
-rwsr-xr-x. root root system_u:object_r:ssh_keysign_exec_t:s0 ssh-keysign
You can manually set SELinux via chcon cmd, or use settings from Policy file via restorecon cmd.
 
Old 03-07-2013, 07:33 AM   #6
earwaxntoast
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Just to update this thread, the solution was:

# override default of no subsystems
#Subsystem sftp /usr/libexec/openssh/sftp-server <---- comment this line out
Subsystem sftp internal-sftp <---- add this line

service sshd restart

Thanks to you two that took the time to reply.
 
Old 10-25-2013, 05:15 AM   #7
ppiper
LQ Newbie
 
Registered: Oct 2013
Posts: 1

Rep: Reputation: Disabled
Lightbulb thx

Quote:
Originally Posted by earwaxntoast View Post
Just to update this thread, the solution was:

# override default of no subsystems
#Subsystem sftp /usr/libexec/openssh/sftp-server <---- comment this line out
Subsystem sftp internal-sftp <---- add this line

service sshd restart

Thanks to you two that took the time to reply.
cool, thx for the answer. An Update reset these settings and your solution saved me some more time to be wasted ^^
 
  


Reply


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
/usr/lib vs /usr/libexec gmartin Slackware 5 04-27-2017 02:35 AM
CUPS printing error: ="/usr/local/libexec/cups/filter/rastertosamsungspl failed ted_chou12 Linux - Software 0 08-04-2012 05:22 AM
Chrooted OpenSSH SFTP server logging issue Sea-you Linux - Server 2 08-03-2011 09:09 PM
[SOLVED] gcc linker error - hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS) chaosless Linux - Software 1 09-17-2009 12:33 PM
Remote backup server: vsftpd/SSL or openssh/sftp or... ? krog Linux - Security 3 04-24-2006 11:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:28 AM.

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