Link to home
Start Free TrialLog in
Avatar of sam15
sam15

asked on

Copy File using SFTP fails

I have a file that needs to be uploaded from RHEL Server 1 to remote RHEL Server 2.

I have SFTP access. When I try to test copy using a small file on local server"  I get a permission denied error show below.


The remote server admin says account has permissions.

1) Do you see anything wrong with the statement below or any other problems?

2) Is there a way to check permission granted to "xyz" account on the folder I am trying to copy to since this is an SFTP prompt and not Shell interface?




$sftp xyz@111.111.111.11

Connected to 
sftp> put /oracle/upload/test.txt     /ing/upload/xyz

Uploading /oracle/upload/test.txt to /ing/upload/xyz/test.txt

remote open("/ing/upload/xyz/test.txt"): Permission denied

sftp> pwd

Remote working directory: /ing/upload/xyz


Avatar of arnold
arnold
Flag of United States of America image

Don't you also have scp access?
SFTP and SCP are part of the openssh.

SFTP put is one option, filename
the destination where you want it has to be achieved using cd to navigate to the remote location.

scp /oracle/upload/test.txt xyz@111.111.111.111:/ing/upload/xyz/

Based on your post, the remote side has your RSA public Key such that no password is needed.

do you have ssh rights to that system?
Do you have permissions on the /ing/upload/xyz path?
Avatar of sam15
sam15

ASKER

no, i used to have ssh/scp access and created key authentication. they seem to disable it on new server. . cant i just copy the file using sftp?


does this show you the "xyz" account has no write privs to the folder? how can i verify permissions
You can look at using expect that will can you manually upload the file
/oracle/upload
sftp xyz@111.111.111.111
cd /ing/,upload/xyz
put test.txt

What happens?
Avatar of sam15

ASKER

same problem nothing changed. If you dont specify the file where path is I get  "no such file or directory"
after i add the path like put /.../../test.txt I get permission denied.

you dont think there is a permission issue here?
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sam15

ASKER

yes i did navigate to the local path. I even changed file permissions to 777.

Then did SFTP and put file and I get same error.

It is really strange because when i did "ls -alt" on sftp destination, I do see that "abc" has write permissions on the directory.
Avatar of sam15

ASKER

strangely when I go to a subdirectory, the file copy works. How do you explain that?

/ing/upload/xyz/ xyz_upload
a mess with privileges on the remote side. can you use regular ssh into the remote box. check with getfacls or test -w
Avatar of sam15

ASKER

I tried SSH before and it I could not get a prompt on remote server. The connection does not seem to work.
what is getfacls?
Ssh xyz@,111.111.111.111 'getfacl /path/where/you/want/info"
Get filesystem access control list is the command.
Advanced option of ls -ll
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sam15

ASKER

it seems they block SSH to tighten security. Does that make sense? I cant even change password.
Are there any alternatives to SSH or would security normally opens it up upon request?
it does make sense. it is even quite possible the ssh server is not actually shell capable at all. there is nothing more you can do without asking them. i would suggest you expose the issue and your debug steps but refrain from asking for a shell.
Avatar of sam15

ASKER

Very good!