Validating scp connection


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Validating scp connection
# 1  
Old 08-02-2016
Question Validating scp connection

Hi Team,

I have 2 servers Server-A & Server-B.

Is there any way to test scp connection between Server-A & Server-B without transferring file?

Basically i want to test the availability of scp connection..

Thanks in advance...
# 2  
Old 08-02-2016
I would actually go the whole way and create a "Hello" type file with the expected permissions and actually copy it. That way you can be sure that you are able to navigate to the correct area and the get what will be the required files.



I hope that this thought helps,
Robin
# 3  
Old 08-02-2016
@rbatte1 Thanks for your response. But i am looking for a way to test scp without transferring file.
# 4  
Old 08-02-2016
scp stands for "secure copy", so how else but by copying do you think you could test it?

scp is a member of the ssh familiy, so if e.g. an ssh login attempt works, the probability of scp working is high.
# 5  
Old 08-02-2016
If ssh works, then scp works as well.
  • You could test if port 22 exists, for example using telnet
  • You could test with ssh if you can do a remote execution, for example a NOP (:)
    Code:
    ssh Server-B :

  • You could see if the remote directory you intend to copy to is writeable (if the dir is on a RW-filesystem)
    Code:
    ssh Server-B '[ -w /path/to/dir ]'

# 6  
Old 08-02-2016
My suggestion to create a dummy file was to check the other parts of the process, not just the secure connection so that you can be sure you are getting to the right path and that the id you connect with can actually read a file with the same permissions. Without that, you are not really testing it properly.

It doesn't have to be a large file if you are worried about the network traffic and time.

Can I presume that you are building up a remote path/filename in your script? If so, are you sure you can get to it? That is the point of testing with a dummy file.



Robin
# 7  
Old 08-02-2016
We are actually creating a script to validate scp conn. So if i create a test file and transfer means there are chances of some invalid files in the target servers.

I don't want to trouble the targer servers for our testing...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Advanced & Expert Users

keep an open connection with scp or another similar program

Does anyone know a way to keep the connection open with scp? I really don't like having to type my password in every time I want to transfer a file. Or is there another similar program that will keep my connection open? (6 Replies)
Discussion started by: cokedude
6 Replies

3. UNIX for Dummies Questions & Answers

SCP Connection Timeout

Hello UNIX users, Thanks for helping me in my earlier post. Now, I am facing a timeout issue when ever I am transferring a zipped file from my server to client's server. If the zipped file size is below 3 MB, it goes fine. Anything above that fails. Below is the part of screenshot from... (1 Reply)
Discussion started by: st3636
1 Replies

4. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

5. UNIX for Advanced & Expert Users

Connection reset by peer..closing connection

Hello I'm facing the above problem while doing a performance run. I've a script which I'm launching from my windows desktop using mozilla. The script will invoke backend action on a Solaris host which in turn feeds the records to a driver located on a linux box(Cent OS). What's happening is... (1 Reply)
Discussion started by: subramanyab
1 Replies

6. HP-UX

SCP transfer failed, lost connection

Hello, We try to do an SCP of a Sybase dump file of 4Go between two production HP-UX servers. Each time the transfer stopn at 299Mo and we have the message "connection lost". The destination FS has largefiles option activated. Could you help ? (7 Replies)
Discussion started by: ohemeg
7 Replies

7. Shell Programming and Scripting

validating data

I have a file like the following aaaaa00005bbbbb aaaaa00108bbbbb The code "00005" and "00108" need to be validated and the list of valid codes are stored in a database. While I loop through the file, should call a sql statement for every records to do the validation? or is... (1 Reply)
Discussion started by: joanneho
1 Replies

8. Shell Programming and Scripting

validating 10. IP address any way possible

HELP: validating IP addresses any way possible -------------------------------------------------------------------------------- I am trying to validate input from the user in a script. I thought is was easy to do using regular expressions but I can't figure out how to use REs in a... (1 Reply)
Discussion started by: nrodolfich
1 Replies

9. Shell Programming and Scripting

Validating $1 and $2 before using

Hi there, I'm trying to validate my $1 and $2 before I use them in the sqlplus update, I think I have the validation rules set correctly??? however when I test my script, it jumps straight into the sql. It doesn't seem to validate the vars....even when I know they are incorrect. if ; then ... (6 Replies)
Discussion started by: nhatch
6 Replies

10. Shell Programming and Scripting

validating dates

This is what I have to check date entries in an interactive script with the end users... I use this to build control cards for a reporting utility supplied by a software vendor. I also want to check to make sure its a valid day based on the month (ie 30days has sept, april, june and Nov..)... ... (2 Replies)
Discussion started by: MizzGail
2 Replies
Login or Register to Ask a Question