{"id":1972,"date":"2012-10-08T06:43:00","date_gmt":"2012-10-08T10:43:00","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1972"},"modified":"2013-03-20T08:38:22","modified_gmt":"2013-03-20T12:38:22","slug":"sftp-error-subsystem-request-for-sftp-failed-subsystem-not-found","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/sftp-error-subsystem-request-for-sftp-failed-subsystem-not-found","title":{"rendered":"SFTP error: Subsystem Request for SFTP Failed, Subsystem Not Found"},"content":{"rendered":"<p>I have a server with &#8216;root&#8217; access but when I tried to SFTP in with the SSH Explorer client, it came up with a <strong>&#8220;subsystem request for sftp failed&#8221;<\/strong> error message. When trying to SFTP in, the SSH (\/var\/log\/secure) logs came up with the following error:<\/p>\n<blockquote>\n<pre>sshd: subsystem request for sftp\r\nsshd: error: subsystem: cannot stat \/usr\/libexec\/sftp-server: No \r\nsuch file or directory\r\nsshd: subsystem request for sftp failed, subsystem not found<\/pre>\n<\/blockquote>\n<p>A user can SFTP in only when SSH access is enabled for the user, in my case, I was using &#8216;root&#8217; as user and was able to SSH in fine.<\/p>\n<p>On further investigation, I found the <strong>&#8216;Subsystem&#8217; parameter for sftp is defined in the SSH configuration<\/strong> file \/etc\/ssh\/sshd_config.<\/p>\n<blockquote>\n<pre># <strong>grep Subsystem \/etc\/ssh\/sshd_config<\/strong>\r\nSubsystem\u00a0 sftp  \/usr\/libexec\/sftp-server<\/pre>\n<\/blockquote>\n<p>This indicates that SFTP is looking \/usr\/libexec\/sftp-server file which is missing<\/p>\n<blockquote>\n<pre># <strong>ls -la \/usr\/libexec\/sftp-server<\/strong>\r\n\/bin\/ls: \/usr\/libexec\/sftp-server: No such file or directory<\/pre>\n<\/blockquote>\n<p>The solution is to find the actual location of the &#8216;sftp-server file and<\/p>\n<p><strong>1)<\/strong> Creating a symlink to it in the \/usr\/libexec\/ directory<br \/>\nOR<br \/>\n<strong>2)<\/strong> Edit the SSH configuration file and specify the correct path to the &#8216;sftp-server&#8217; file in the &#8216;Subsystem&#8217; parameter.<\/p>\n<p>Locate the sftp-server file:<\/p>\n<blockquote>\n<pre># <strong>find \/ -name sftp-server<\/strong>\r\n\/usr\/libexec\/openssh\/sftp-server<\/pre>\n<\/blockquote>\n<p>and <strong>create a symlink<\/strong> to the actual file<\/p>\n<blockquote>\n<pre># <strong>ln -s \/usr\/libexec\/openssh\/sftp-server \/usr\/libexec\/sftp-server<\/strong><\/pre>\n<\/blockquote>\n<p>Restart the SSHD service<\/p>\n<blockquote>\n<pre># <strong>service sshd restart<\/strong><\/pre>\n<\/blockquote>\n<p>You should be able to SFTP in successfully.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a server with &#8216;root&#8217; access but when I tried to SFTP in with the SSH Explorer client, it came up with a &#8220;subsystem request for sftp failed&#8221; error message. When trying to SFTP in, the SSH (\/var\/log\/secure) logs came up with the following error:<\/p>\n<p>sshd: subsystem request for sftp<br \/>\nsshd: error: subsystem: cannot stat \/usr\/libexec\/sftp-server: No<br \/>\nsuch file or directory<br \/>\nsshd: subsystem request for sftp failed, subsystem not found<\/p>\n<p>A user can SFTP in only when SSH access is enabled for the user, in my case, I was using &#8216;root&#8217; [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1428,1429,1432,1427,1430,1433,1431],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1972"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1972"}],"version-history":[{"count":10,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1972\/revisions"}],"predecessor-version":[{"id":1980,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1972\/revisions\/1980"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}