Thread: [JSch-users] Cannot sftp files from linux server to windows server
Status: Alpha
Brought to you by:
ymnk
From: Deepesh N. <dee...@gm...> - 2011-06-16 22:09:13
|
Hi All, I am using jsch to tranfer files via jsch. I am able to transfer files from linux servers to other linux servers. But when I am trying to transfer files from a linux server to a windows server...it is throwing me 'No Such File' error. I am using jsch 0.1.44 version. Is there a work around for this ? Any help would be appreicated. -Deepesh |
From: Magid, J. (Joe) <Jos...@us...> - 2011-06-16 22:46:09
|
Do you have a trailing / after the file name by any chance? ~~~~~~~~~~~~~~~~~~~~~~~ Joe Magid Senior Developer ING - Annuity Manufacturing IT Production Support Jos...@us... ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Thursday, June 16, 2011 06:09 PM To: jsc...@li... Subject: [JSch-users] Cannot sftp files from linux server to windows server Hi All, I am using jsch to tranfer files via jsch. I am able to transfer files from linux servers to other linux servers. But when I am trying to transfer files from a linux server to a windows server...it is throwing me 'No Such File' error. I am using jsch 0.1.44 version. Is there a work around for this ? Any help would be appreicated. -Deepesh --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ============================================================================================ |
From: Deepesh N. <dee...@gm...> - 2011-06-17 12:15:47
|
No, I don't have trailing in the file name. I tried with hard coding the file name too. But it just doesn't work for transferring files to a remote windows server. -Deepesh On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) <Jos...@us...>wrote: > ** > Do you have a trailing / after the file name by any chance? > > > ~~~~~~~~~~~~~~~~~~~~~~~ > Joe Magid > Senior Developer > ING - Annuity Manufacturing IT Production Support > Jos...@us... > > > ------------------------------ > *From:* Deepesh Naidu [mailto:dee...@gm...] > *Sent:* Thursday, June 16, 2011 06:09 PM > *To:* jsc...@li... > *Subject:* [JSch-users] Cannot sftp files from linux server to windows > server > > Hi All, > > I am using jsch to tranfer files via jsch. > I am able to transfer files from linux servers to other linux servers. > But when I am trying to transfer files from a linux server to a windows > server...it is throwing me 'No Such File' error. > > I am using jsch 0.1.44 version. > Is there a work around for this ? > Any help would be appreicated. > > -Deepesh > > --------------------------------------------------------- > > NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. > > ============================================================================================ > > |
From: Magid, J. (Joe) <Jos...@us...> - 2011-06-17 15:16:55
|
Are you opening an sftp channel or are you doing an scp connect via an exec channel? If the latter (which is what we do) is the user/service ID that you are using to connect to the Windows server in either the Admin or Power Users group? Scp requires login rights for the login id. As per Paul's suggestion, please post your code so we can see what you're doing to better help you resolve the issue. ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Friday, June 17, 2011 08:16 AM To: Magid, J. (Joe) Cc: jsc...@li... Subject: Re: [JSch-users] Cannot sftp files from linux server to windows server No, I don't have trailing in the file name. I tried with hard coding the file name too. But it just doesn't work for transferring files to a remote windows server. -Deepesh On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) <Jos...@us...> wrote: Do you have a trailing / after the file name by any chance? ~~~~~~~~~~~~~~~~~~~~~~~ Joe Magid Senior Developer ING - Annuity Manufacturing IT Production Support Jos...@us... ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Thursday, June 16, 2011 06:09 PM To: jsc...@li... Subject: [JSch-users] Cannot sftp files from linux server to windows server Hi All, I am using jsch to tranfer files via jsch. I am able to transfer files from linux servers to other linux servers. But when I am trying to transfer files from a linux server to a windows server...it is throwing me 'No Such File' error. I am using jsch 0.1.44 version. Is there a work around for this ? Any help would be appreicated. -Deepesh --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ======================================================================== ==================== |
From: Deepesh N. <dee...@gm...> - 2011-06-17 15:32:02
|
Hi All, Thanks for all the suggestions. I have been able to successfully SFTP files to a remote windows server from a linux server. The issue I was facing is as follows: My previous code: Channel channel = null; ChannelSftp c = null; channel = session.openChannel("sftp"); channel.connect(); c = (ChannelSftp)channel; *c.cd("C:\\"); ----- This is what was creating an issue.* * * I then checked what my home directory is and i found out that it was following a pattern of */abc/xyz*. * * So I changed the last line of the code to c.cd("/abc/xyz") and it is working fine. The folder /abc/xyz resides in the home directory of the ssh folder...where all the user credentials are entered. That directory happens to be C:\Program Files\somefolder. Now I am trying to sftp some files into the C:\ folder, but I have not been able to reach that folder as it will not go beyond C:\Program Files\somefolder. I am still working on this part but haven't made any headway. Any pointers on that. But atleast we got somewhere. -Deepesh * * On Fri, Jun 17, 2011 at 11:16 AM, Magid, J. (Joe) <Jos...@us...>wrote: > ** > Are you opening an sftp channel or are you doing an scp connect via an exec > channel? > > If the latter (which is what we do) is the user/service ID that you are > using to connect to the Windows server in either the Admin or Power Users > group? Scp requires login rights for the login id. > > As per Paul's suggestion, please > post your code so we can see what you're doing to better help you resolve the issue. > > > ------------------------------ > *From:* Deepesh Naidu [mailto:dee...@gm...] > *Sent:* Friday, June 17, 2011 08:16 AM > *To:* Magid, J. (Joe) > *Cc:* jsc...@li... > *Subject:* Re: [JSch-users] Cannot sftp files from linux server to windows > server > > No, I don't have trailing in the file name. > I tried with hard coding the file name too. > But it just doesn't work for transferring files to a remote windows server. > > -Deepesh > > > On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) <Jos...@us...>wrote: > >> ** >> Do you have a trailing / after the file name by any chance? >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~ >> Joe Magid >> Senior Developer >> ING - Annuity Manufacturing IT Production Support >> Jos...@us... >> >> >> ------------------------------ >> *From:* Deepesh Naidu [mailto:dee...@gm...] >> *Sent:* Thursday, June 16, 2011 06:09 PM >> *To:* jsc...@li... >> *Subject:* [JSch-users] Cannot sftp files from linux server to windows >> server >> >> Hi All, >> >> I am using jsch to tranfer files via jsch. >> I am able to transfer files from linux servers to other linux servers. >> But when I am trying to transfer files from a linux server to a windows >> server...it is throwing me 'No Such File' error. >> >> I am using jsch 0.1.44 version. >> Is there a work around for this ? >> Any help would be appreicated. >> >> -Deepesh >> >> --------------------------------------------------------- >> >> NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. >> >> ============================================================================================ >> >> > |
From: Paul E. <Pau...@gm...> - 2011-06-17 14:31:14
|
Deepesh Naidu schrieb: > Hi All, > > I am using jsch to tranfer files via jsch. > I am able to transfer files from linux servers to other linux servers. > But when I am trying to transfer files from a linux server to a windows > server...it is throwing me 'No Such File' error. Show the code. Most probable the problem is in your way of using the ChannelSftp. Paŭlo |
From: Magid, J. (Joe) <Jos...@us...> - 2011-06-17 15:44:58
|
Even though you are connecting to a Windows server, the sFTP service you are connecting to is highly likely to be acting as if it were on a Unix box; we've got Cygwin installed and an OpenSSH service running. So that service is going to see the c drive on the box it's on as /cygdrive/c. We've done an ssh connection to our destination Windows file server using the login service ID, created a folder called /opt (from the "root" perspective of the logged in session) and then created symlinks in that folder to point to the appropriate folders where data is to be dropped to make them addressable without having to use the /cygdrive reference. ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Friday, June 17, 2011 11:32 AM To: Magid, J. (Joe) Cc: jsc...@li... Subject: Re: [JSch-users] Cannot sftp files from linux server to windows server Hi All, Thanks for all the suggestions. I have been able to successfully SFTP files to a remote windows server from a linux server. The issue I was facing is as follows: My previous code: Channel channel = null; ChannelSftp c = null; channel = session.openChannel("sftp"); channel.connect(); c = (ChannelSftp)channel; c.cd("C:\\"); ----- This is what was creating an issue. I then checked what my home directory is and i found out that it was following a pattern of /abc/xyz. So I changed the last line of the code to c.cd("/abc/xyz") and it is working fine. The folder /abc/xyz resides in the home directory of the ssh folder...where all the user credentials are entered. That directory happens to be C:\Program Files\somefolder. Now I am trying to sftp some files into the C:\ folder, but I have not been able to reach that folder as it will not go beyond C:\Program Files\somefolder. I am still working on this part but haven't made any headway. Any pointers on that. But atleast we got somewhere. -Deepesh On Fri, Jun 17, 2011 at 11:16 AM, Magid, J. (Joe) <Jos...@us...> wrote: Are you opening an sftp channel or are you doing an scp connect via an exec channel? If the latter (which is what we do) is the user/service ID that you are using to connect to the Windows server in either the Admin or Power Users group? Scp requires login rights for the login id. As per Paul's suggestion, please post your code so we can see what you're doing to better help you resolve the issue. ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Friday, June 17, 2011 08:16 AM To: Magid, J. (Joe) Cc: jsc...@li... Subject: Re: [JSch-users] Cannot sftp files from linux server to windows server No, I don't have trailing in the file name. I tried with hard coding the file name too. But it just doesn't work for transferring files to a remote windows server. -Deepesh On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) <Jos...@us...> wrote: Do you have a trailing / after the file name by any chance? ~~~~~~~~~~~~~~~~~~~~~~~ Joe Magid Senior Developer ING - Annuity Manufacturing IT Production Support Jos...@us... ________________________________ From: Deepesh Naidu [mailto:dee...@gm...] Sent: Thursday, June 16, 2011 06:09 PM To: jsc...@li... Subject: [JSch-users] Cannot sftp files from linux server to windows server Hi All, I am using jsch to tranfer files via jsch. I am able to transfer files from linux servers to other linux servers. But when I am trying to transfer files from a linux server to a windows server...it is throwing me 'No Such File' error. I am using jsch 0.1.44 version. Is there a work around for this ? Any help would be appreicated. -Deepesh --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ======================================================================== ==================== |
From: Deepesh N. <dee...@gm...> - 2011-06-17 15:48:07
|
Hi Joe, We are using OpenSSH service but will have to see if we installed cygwin or something else. Thanks. -Deepesh On Fri, Jun 17, 2011 at 11:44 AM, Magid, J. (Joe) <Jos...@us...>wrote: > ** > Even though you are connecting to a Windows server, the sFTP service you > are connecting to is highly likely to be acting as if it were on a Unix box; > we've got Cygwin installed and an OpenSSH service running. So that service > is going to see the c drive on the box it's on as /cygdrive/c. > > We've done an ssh connection to our destination Windows file server using > the login service ID, created a folder called /opt (from the "root" > perspective of the logged in session) and then created symlinks in that > folder to point to the appropriate folders where data is to be dropped to > make them addressable without having to use the /cygdrive reference. > > > ------------------------------ > *From:* Deepesh Naidu [mailto:dee...@gm...] > *Sent:* Friday, June 17, 2011 11:32 AM > > *To:* Magid, J. (Joe) > *Cc:* jsc...@li... > *Subject:* Re: [JSch-users] Cannot sftp files from linux server to windows > server > > Hi All, > > Thanks for all the suggestions. > I have been able to successfully SFTP files to a remote windows server from > a linux server. > The issue I was facing is as follows: > > My previous code: > Channel channel = null; > ChannelSftp c = null; > channel = session.openChannel("sftp"); > channel.connect(); > c = (ChannelSftp)channel; > *c.cd("C:\\"); ----- This is what was creating an issue.* > * > * > I then checked what my home directory is and i found out that it was > following a pattern of */abc/xyz*. > * > * > So I changed the last line of the code to c.cd("/abc/xyz") and it is > working fine. > The folder /abc/xyz resides in the home directory of the ssh folder...where > all the user credentials are entered. > That directory happens to be C:\Program Files\somefolder. > > Now I am trying to sftp some files into the C:\ folder, but I have not been > able to reach that folder as it will not go beyond C:\Program > Files\somefolder. I am still working on this part but haven't made any > headway. Any pointers on that. > But atleast we got somewhere. > > > -Deepesh > > > * > * > On Fri, Jun 17, 2011 at 11:16 AM, Magid, J. (Joe) <Jos...@us... > > wrote: > >> ** >> Are you opening an sftp channel or are you doing an scp connect via an >> exec channel? >> >> If the latter (which is what we do) is the user/service ID that you are >> using to connect to the Windows server in either the Admin or Power Users >> group? Scp requires login rights for the login id. >> >> As per Paul's suggestion, please >> post your code so we can see what you're doing to better help you resolve the issue. >> >> >> ------------------------------ >> *From:* Deepesh Naidu [mailto:dee...@gm...] >> *Sent:* Friday, June 17, 2011 08:16 AM >> *To:* Magid, J. (Joe) >> *Cc:* jsc...@li... >> *Subject:* Re: [JSch-users] Cannot sftp files from linux server to >> windows server >> >> No, I don't have trailing in the file name. >> I tried with hard coding the file name too. >> But it just doesn't work for transferring files to a remote windows >> server. >> >> -Deepesh >> >> >> On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) <Jos...@us... >> > wrote: >> >>> ** >>> Do you have a trailing / after the file name by any chance? >>> >>> >>> ~~~~~~~~~~~~~~~~~~~~~~~ >>> Joe Magid >>> Senior Developer >>> ING - Annuity Manufacturing IT Production Support >>> Jos...@us... >>> >>> >>> ------------------------------ >>> *From:* Deepesh Naidu [mailto:dee...@gm...] >>> *Sent:* Thursday, June 16, 2011 06:09 PM >>> *To:* jsc...@li... >>> *Subject:* [JSch-users] Cannot sftp files from linux server to windows >>> server >>> >>> Hi All, >>> >>> I am using jsch to tranfer files via jsch. >>> I am able to transfer files from linux servers to other linux servers. >>> But when I am trying to transfer files from a linux server to a windows >>> server...it is throwing me 'No Such File' error. >>> >>> I am using jsch 0.1.44 version. >>> Is there a work around for this ? >>> Any help would be appreicated. >>> >>> -Deepesh >>> >>> --------------------------------------------------------- >>> >>> NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. >>> >>> ============================================================================================ >>> >>> >> > |
From: Deepesh N. <dee...@gm...> - 2011-06-17 16:07:31
|
Hi Joe, Thanks for the solution....it worked. -Deepesh On Fri, Jun 17, 2011 at 11:48 AM, Deepesh Naidu <dee...@gm...>wrote: > Hi Joe, > > We are using OpenSSH service but will have to see if we installed cygwin or > something else. > Thanks. > > -Deepesh > > > On Fri, Jun 17, 2011 at 11:44 AM, Magid, J. (Joe) <Jos...@us... > > wrote: > >> ** >> Even though you are connecting to a Windows server, the sFTP service you >> are connecting to is highly likely to be acting as if it were on a Unix box; >> we've got Cygwin installed and an OpenSSH service running. So that service >> is going to see the c drive on the box it's on as /cygdrive/c. >> >> We've done an ssh connection to our destination Windows file server using >> the login service ID, created a folder called /opt (from the "root" >> perspective of the logged in session) and then created symlinks in that >> folder to point to the appropriate folders where data is to be dropped to >> make them addressable without having to use the /cygdrive reference. >> >> >> ------------------------------ >> *From:* Deepesh Naidu [mailto:dee...@gm...] >> *Sent:* Friday, June 17, 2011 11:32 AM >> >> *To:* Magid, J. (Joe) >> *Cc:* jsc...@li... >> *Subject:* Re: [JSch-users] Cannot sftp files from linux server to >> windows server >> >> Hi All, >> >> Thanks for all the suggestions. >> I have been able to successfully SFTP files to a remote windows server >> from a linux server. >> The issue I was facing is as follows: >> >> My previous code: >> Channel channel = null; >> ChannelSftp c = null; >> channel = session.openChannel("sftp"); >> channel.connect(); >> c = (ChannelSftp)channel; >> *c.cd("C:\\"); ----- This is what was creating an issue.* >> * >> * >> I then checked what my home directory is and i found out that it was >> following a pattern of */abc/xyz*. >> * >> * >> So I changed the last line of the code to c.cd("/abc/xyz") and it is >> working fine. >> The folder /abc/xyz resides in the home directory of the ssh >> folder...where all the user credentials are entered. >> That directory happens to be C:\Program Files\somefolder. >> >> Now I am trying to sftp some files into the C:\ folder, but I have not >> been able to reach that folder as it will not go beyond C:\Program >> Files\somefolder. I am still working on this part but haven't made any >> headway. Any pointers on that. >> But atleast we got somewhere. >> >> >> -Deepesh >> >> >> * >> * >> On Fri, Jun 17, 2011 at 11:16 AM, Magid, J. (Joe) < >> Jos...@us...> wrote: >> >>> ** >>> Are you opening an sftp channel or are you doing an scp connect via an >>> exec channel? >>> >>> If the latter (which is what we do) is the user/service ID that you are >>> using to connect to the Windows server in either the Admin or Power Users >>> group? Scp requires login rights for the login id. >>> >>> As per Paul's suggestion, please >>> post your code so we can see what you're doing to better help you resolve the issue. >>> >>> >>> ------------------------------ >>> *From:* Deepesh Naidu [mailto:dee...@gm...] >>> *Sent:* Friday, June 17, 2011 08:16 AM >>> *To:* Magid, J. (Joe) >>> *Cc:* jsc...@li... >>> *Subject:* Re: [JSch-users] Cannot sftp files from linux server to >>> windows server >>> >>> No, I don't have trailing in the file name. >>> I tried with hard coding the file name too. >>> But it just doesn't work for transferring files to a remote windows >>> server. >>> >>> -Deepesh >>> >>> >>> On Thu, Jun 16, 2011 at 6:11 PM, Magid, J. (Joe) < >>> Jos...@us...> wrote: >>> >>>> ** >>>> Do you have a trailing / after the file name by any chance? >>>> >>>> >>>> ~~~~~~~~~~~~~~~~~~~~~~~ >>>> Joe Magid >>>> Senior Developer >>>> ING - Annuity Manufacturing IT Production Support >>>> Jos...@us... >>>> >>>> >>>> ------------------------------ >>>> *From:* Deepesh Naidu [mailto:dee...@gm...] >>>> *Sent:* Thursday, June 16, 2011 06:09 PM >>>> *To:* jsc...@li... >>>> *Subject:* [JSch-users] Cannot sftp files from linux server to windows >>>> server >>>> >>>> Hi All, >>>> >>>> I am using jsch to tranfer files via jsch. >>>> I am able to transfer files from linux servers to other linux servers. >>>> But when I am trying to transfer files from a linux server to a windows >>>> server...it is throwing me 'No Such File' error. >>>> >>>> I am using jsch 0.1.44 version. >>>> Is there a work around for this ? >>>> Any help would be appreicated. >>>> >>>> -Deepesh >>>> >>>> --------------------------------------------------------- >>>> >>>> NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. >>>> >>>> ============================================================================================ >>>> >>>> >>> >> > |