Exit Status 255, Connection closed in SFTP


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Exit Status 255, Connection closed in SFTP
# 1  
Exit Status 255, Connection closed in SFTP

I'm trying to connect from Server A to Server B to transfer files from A to B. I'm using NUID A1 in Server A and NUID A2 in Server B. I have done the following the steps to setup password-less login.
1. Add the public key of A1 in A to the Authorized keys of A2 in B.
2. Add the public key of Server A to the Known hosts file of A2 in B.


The following command is used to transfer the files from A to B.
Code:
sftp -vvv -o BatchMode='yes' -b -f SourceDir/File -d Destination_Dir/File UserID Machine_Name
sftp -vvv -o BatchMode='yes' -b -f /var/tmp/fileA.txt -d /var/tmp/fileA.txt A2 ServerB

In this case the UserID is the NUID A2 in ServerB
Machine Name = Server B

Below is the output I get while attempting connection:
Code:
debug1: Connecting to Server B [Server B's IP Address] port 22
debug1: Connection established
debug1: Next Authentication method: publickey
debug1: Offering public key: /export/home/A1/.ssh/id_rsa.pub
debug1: Authentication succeeded (publickey)
debug1: Exit status 255
Connection closed

Kindly help me in resolving this issue. The NUIDs in both the servers are Non-Interactive (hence no password). However the required keys are added in the corresponding locations and verified. Any help is much appreciated and thanked !!!
Moderator's Comments:
Mod Comment Please use CODE tags; (not COLOR tags) to display sample input, sample output, and code segments.

Last edited by Don Cragun; 03-06-2016 at 04:26 PM.. Reason: Change COLOR tags to CODE tags.
# 2  
You request batch mode but don't provice a batchfile. man sftp:
Quote:
-b batchfile
Batch mode reads a series of commands from an input batchfile instead of stdin.
# 3  
hi RudiC,
Sorry to have not mentioned.. Yes we also pass a batch file to read inputs during the batch mode.. Still the same case. Appreciate your support.. Thanks...
# 4  
How do you pass the batch file?
# 5  
Code:
sftp -vvv -o BatchMode='yes' -b 
batchfile


Last edited by Don Cragun; 03-06-2016 at 04:27 PM.. Reason: Add CODE tags again.
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #876
Difficulty: Medium
All operational code must be POSIX compliant in order to be cost effective.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check the status of sftp connection is successful or not in Linux?

Hi All, We are working on linux with putty terminal for file transferring using SFTP server... here we want to know /We have Urgent Requirement If SFTP connection is successfull then we should get .txt log file in target locaton as "Success/Failure" Please provide batch script for above... (7 Replies)
Discussion started by: sravanreddy
7 Replies

2. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

3. UNIX for Dummies Questions & Answers

SFTP Issue - Connection closed

Hi All, I have followed the steps to set up the public and private keys for SFTP setup. Somehow the SFTP is not working and I get following errors: ==> sftp -v remote_user@remote_host_name_changed OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010 debug1: Reading configuration data... (12 Replies)
Discussion started by: Hangman2
12 Replies

4. AIX

ssh connection closed by ip

Hi i am trying to do ssh without password between 2 aix servers. before i generate the keys, i am able to do the ssh & it is asking for password & i am able to login. ======================== # ssh 172.29.150.77 root@172.29.150.77's password: ======================== but when i generate rsa... (1 Reply)
Discussion started by: makarand.bhatka
1 Replies

5. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

6. UNIX for Advanced & Expert Users

Tomcat Connection closed

Hi how can do why a process closed a connection? # lsof -i tcp:8080 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME java 5851 tomcat 29u IPv6 73216185 TCP *:webcache (LISTEN) # telnet localhost 8080 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1).... (0 Replies)
Discussion started by: lain
0 Replies

7. HP-UX

ftp first connection closed

Hi, Have anyone seen this problem, there is one remote side where their ftp connection to our server will always fail with connection closed by remote host and the second connection will be working. is this an OS issue or network issue? Thanks Robert (4 Replies)
Discussion started by: robertngo
4 Replies

8. UNIX for Dummies Questions & Answers

ssh_exchange_identification: Connection closed by remote host Connection closed

Hi Everyone, Good day. Scenario: 2 unix servers -- A (SunOS) and B (AIX) I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time. Some of these sftp's fail with the following error: ssh_exchange_identification: Connection... (1 Reply)
Discussion started by: jeevan_fimare
1 Replies

9. Solaris

Exit status 255 on sftp

HI guys When i try SFTP to a machine using a user account whose entry in /etc/passwd as follows user:x:8005:508::/export/home/user:/bin/false and i am not placed my keys over there i am using the password option in the sftp Since the keys are not there it ask for the password ... (5 Replies)
Discussion started by: GIC1986
5 Replies

10. UNIX for Advanced & Expert Users

SFTP Connection Closed

Hey when trying to connect to a server using a key I get sftp -o 'Port=22' -o'IdentityFile=/home/datatel/.ssh/id_dsa_xei' becker_xei@host Connecting to host... ANGEL SFTP ServerConnection closed by host Connection closed Any ideas? (1 Reply)
Discussion started by: ed.browne
1 Replies

Featured Tech Videos