Understanding SFTP

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Understanding SFTP
# 1  
Old 09-19-2011
Understanding SFTP

Hi All,
I am new to SFTP, would like to understand a few things about SFTP.
Below are a few questions.

1) I have two servers and accounts in each
Say, user1@server1
I have setup password less sftp connection (rsa keys) from user1@server1 to user2@server2
i.e., i am able to connect to server2 from server1 using "sftp user2@server2"
Now, i have a folder "/u16/mydir/folder2" with "d---------" access rights in server2.
Owner is different from user1 and user2. Say "folderowner"
Step1 : i logged into server2 directly using user2.
when i do "cd /u16/mydir/folder2" .. it worked.
( I assumed that will throw error as there are no read and excute access on that directory).
How was this possible?

Step2 : i logged into server1 and connected to server2 using "sftp user2@server2"
now when i did "cd /u16/mydir/folder2" .. it did not work.

What is the difference? When i tried using direct login into server1 (Step1) it worked , but when i
use same user through sftp it did not.

2) I came across certain posts about below errors
Couldn't canonicalise:
Couldn't get handle:
What are the scenarios these errors occurs. Most of the posts say that its Permission problem,
Is it possible for anyone give me a detailed steps to replicate these errors, so that i can understand the
reasons correctly.

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need your help in understanding this

Hi, I found this in a script and I would like to know how this works Code is here: # var1=PART1_PART2 # var2=${var1##*_} # echo $var2 PART2 I'm wondering how ##* makes the Shell to understand to pick up the last value from the given. (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

2. Shell Programming and Scripting

Sftp : not able to print the echo statements after the sftp transfer

I had the below sftp script working perfectly but the problem is I am not able to send the echo statements . #!/bin/sh echo "Starting to sftp..." sftp admin@myip << END_SCRIPT cd /remotepath/ lcd /localpath/ mget myfiles*.csv bye END_SCRIPT echo "Sftp successfully." echo echo... (11 Replies)
Discussion started by: scriptscript
11 Replies

3. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

4. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@ The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

5. AIX

Help in Understanding ISMP

Hi, Good day to everyone. This is my first time joining the community and wanted to say thanks in advance for all your help and assistance. First, I am not expert in AIX and UNIX but I do know a thing or two and I have a simple question regarding ISMP. We are using AIX 5.3 and a couple... (0 Replies)
Discussion started by: lgalang
0 Replies

6. UNIX for Dummies Questions & Answers

Understanding Groups

Hi cat /etc/group : .... oinstall:x:401: dba:x:400:oracle ... cat /etc/passwd|grep oracle oracle:x:130:401::/home/oracle:/bin/ksh 1. Is that mean that : ORACLE user has OINSTALL as it Primary group and DBA as secondary group ? 2. What is the linux comman to set ORACLE user with... (2 Replies)
Discussion started by: yoavbe
2 Replies

7. UNIX for Dummies Questions & Answers

understanding {%/*}/

Hi Gurus: I am trying to understand the following line of code.I did enough of googling to understand but no luck.Please help me understand the follow chunk of code: X=$0 MOD=${X%/*}/env.ksh X is the current script from which I am trying to execute. Say if X=test.ksh $MOD is echoing :... (3 Replies)
Discussion started by: vemana
3 Replies

8. Shell Programming and Scripting

need help understanding mv

I just started shell coding and I'm a bit confused on how 'mv' works can someone explain to me how it works and if i did this correctly. Thanks. echo "Enter Name of the first file:" read file1 #echo $file1 if ; then echo "Sorry, file does not exist." exit 1 ... (16 Replies)
Discussion started by: taiL
16 Replies

9. AIX

SFTP Failed---Request for subsystem 'sftp' failed on channel 0

Hi, While I am trying SFTP my machine to another unix machine , it was working fine till 10 min back. But now i am getting the below error "Request for subsystem 'sftp' failed on channel 0" Could you please someone help me to solve or analyise the root cause... Cheers:b:, Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies
Login or Register to Ask a Question
libssh2_sftp_close_handle(3)					  libssh2 manual				      libssh2_sftp_close_handle(3)

libssh2_sftp_close_handle - close filehandle SYNOPSIS
#include <libssh2.h> #include <libssh2_sftp.h> int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle); int libssh2_sftp_close(LIBSSH2_SFTP_HANDLE *handle); int libssh2_sftp_closedir(LIBSSH2_SFTP_HANDLE *handle); DESCRIPTION
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3) or libssh2_sftp_opendir(3) (which is a macro). Close an active LIBSSH2_SFTP_HANDLE. Because files and directories share the same underlying storage mechanism these methods may be used interchangably. libssh2_sftp_close(3) and libssh2_sftp_closedir(3) are macros for libssh2_sftp_close_handle(3). RETURN VALUE
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se. ERRORS
LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed. LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket. LIBSSH2_ERROR_SOCKET_TIMEOUT - LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was received on the socket, or an SFTP operation caused an errorcode to be returned by the server. SEE ALSO
libssh2_sftp_open_ex(3) libssh2 0.15 1 Jun 2007 libssh2_sftp_close_handle(3)