Could not do file transfer in sftp and able to login

Hi All,

I created an sftp connection 9.8 webmethods but i am tryng to access the directory to process some files it is throwing an error “Error opening remote file” this is due to reading the directory. The home directory does not have read write permission.To grant the permission to the “/” directory i don’t know what is the correct path .could any one help me in the same.

Thanks
Rajshekhar


Could you explain your use-case and also explore the SFTP public API services provided as part of WmPublic.

I configure the sftp using openssh and i tried to login through coreftp client and it is able to login now i am trying to place the .txt files to process but i am not able to place the files into the directory as it is not allowing me to do that.

Below is the screen shot of the error i am geting in webmethods while creating the directory in sftp location

Hi Raj,

can you explain, why it is neccessary to use the root directory ‘/’ directly instead of an existing directory.

Regards,
Holger

Hi,

Thanks for replying actually we can use any directory but I don’t know how and where to change the sftp directory if you can can please tell me how to change this root directory to my custom directory let me know.

Hi Raj,

just specifiy the directory together with the filename for the remote filename input to the put service.

Regards,
Holger

Flow snippet:

pub.client.sftp:login
pub.client.sftp:cd (if you already have a directory under the root directory)
pub.client.sftp:chmod (provide write and read access if not)
pub.client.sftp:put
pub.client.sftp:logout

OR

To create directory

pub.client.sftp:login
pub.client.sftp:cd (if you already have a directory under the root directory)
pub.client.sftp:mkdir
pub.client.sftp:put
pub.client.sftp:logout

Pass on your sample flow package to suggest further.

1 Like

Hi,

thanks to Mahesh for the outlines of the code snippets.

Regards,
Holger

Hello Mahesh,

Thanks for the reply. I tried to give the read write permission but I am getting the forllowing error.

Thanks
Raj

Hi Raj,

are you logging in as root to your sftp server?

This usually restricted by sshd process configuration.

As path “/” belongs to root:root you are not allowed to modify its permssions when not logging in as root.

The mentioned permissions should not be set to “/” by default to avoid corruption of unix installation.

Regards,
Holger

Hi Thomsen,

So how do i change the root directory.I had access to the SSHD configuration file so in that where and what i need to do change

Thanks
Raj

Hi Raj,

when the user your are using for sftp login is configured as chroot user you will see a “/” directory which is internally mapped to the user´s home directory.

On this you can grant whatever permission you want.

But if this is not configured as a chroot user you should any configurations to modify the permissions of the “/” directory as this might render your installation vulnerable for certain things. This should be reported by security scans on the system.

Please elaborate on this and get in contact with your Unix Administrator for clarification.

Regards,
Holger