[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

Need something like WinSCP for unix environment for SSH2 file transfer

I am using Unix environment and would like to transfer a file using SSH2 protocol. We also need to do a key exchange in the process. Can you help me with this? Is there any substitute for WinSCP which can be used in UNIX enviroment. Please let me know if you need additiona info
0
g46905
Asked:
g46905
  • 9
  • 8
1 Solution
 
ravenplCommented:
Unix's ssh is shipped with 'scp' command. But it's command line interface only. Do You need windows?
0
 
g46905Author Commented:
I need UNIX. Can you give me an example using scp command in UNIX

Thanks
0
 
ravenplCommented:
try: scp localfilename login@remote.server:/remote/path/
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
g46905Author Commented:
How do I path the private key along with the command?
0
 
ravenplCommented:
-i /path/to/private/key # it have to be RO for running user
0
 
g46905Author Commented:
what is RO ?
0
 
g46905Author Commented:
when I use -i /path/to/private/key as mentioned above, I am getting "Not a directory". Can you tell me why?
0
 
ravenplCommented:
read-only
0
 
ravenplCommented:
You are not using the literal
-i /path/to/private/key
Do You? You have to put there path to Your keyfile
0
 
g46905Author Commented:
what is a literal. Below is what I am doing. Please let me know if I am doing incorrect?

scp myfile userid@hostname:myfile1-i /local/private/keyfile

where "myname" is the file on the local system that you wish to copy, userid@hostname is the userid and hostname where you wish to copy it, and "myfile1" is the name I want to call the file on the remote system. "keyfile" is my private key I want to exchange.
0
 
ravenplCommented:
> /local/private/keyfile
And it's valid path?
ls -l /local/private/keyfile

also, You may try: scp -vvv ...same options...
0
 
g46905Author Commented:
I did "ls -l /local/private/keyfile" and it works fine. But when I do "-i /local/private/keyfile", it doesn't work...

0
 
ravenplCommented:
What kind of unix You run?
What shows: ssh -v
0
 
g46905Author Commented:
Below is what I see for "ssh -v". ?

Sun_SSH_1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
Usage: ssh [options] host [command]
Options:
  -l user     Log in using this user name.
  -n          Redirect input from /dev/null.
  -F config   Config file (default: ~/.ssh/config).
  -A          Enable authentication agent forwarding.
  -a          Disable authentication agent forwarding (default).
  -X          Enable X11 connection forwarding.
  -x          Disable X11 connection forwarding (default).
  -i file     Identity for public key authentication (default: ~/.ssh/identity)
  -t          Tty; allocate a tty even if command is given.
  -T          Do not allocate a tty.
  -v          Verbose; display verbose debugging messages.
              Multiple -v increases verbosity.
  -V          Display version number only.
  -q          Quiet; don't display any warning messages.
  -f          Fork into background after authentication.
  -e char     Set escape character; ``none'' = disable (default: ~).
  -c cipher   Select encryption algorithm
  -m macs     Specify MAC algorithms for protocol version 2.
  -p port     Connect to this port.  Server must be on the same port.
  -L listen-port:host:port   Forward local port to remote address
  -R listen-port:host:port   Forward remote port to local address
              These cause ssh to listen for connections on a port, and
              forward them to the other side by connecting to host:port.
  -D port     Enable dynamic application-level port forwarding.
  -C          Enable compression.
  -N          Do not execute a shell or command.
  -g          Allow remote hosts to connect to forwarded ports.
  -1          Force protocol version 1.
  -2          Force protocol version 2.
  -4          Use IPv4 only.
  -6          Use IPv6 only.
  -o 'option' Process the option as if it was read from a configuration file.
  -s          Invoke command (mandatory) as SSH2 subsystem.
  -b addr     Local IP address.
0
 
ravenplCommented:
I can see -i option is/should_be supported. I don't know why it will not work.
try: ssh -vvv ..., maybe it will print some info why reading the file fails
0
 
g46905Author Commented:
I have tried that it gives me the same result ?
0
 
udhaCommented:
If you have a GUI on that system, such as nautilus for GNOME, you can simply type this into your address bar: ssh://userid@hostname and then browse the remote system just like WinSCP would.
0
 
g46905Author Commented:
I have learned that our network does not allow using SCP for external transfer of files?
When I use the below mentioned command....it doesn't work.
scp -t -d " + remoteTargetDirectory

Since SCP is not permissable, can you suggest an alternative that would do similar job?
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now