Sponsored Content
Top Forums Shell Programming and Scripting Copying a text file from my Ubuntu Windows Sub System to a remote instance through SSH Post 303027660 by gull04 on Friday 21st of December 2018 09:19:34 AM
Old 12-21-2018
Hi,

I would think that the standard scp functionality would be what you need as in;

Code:
sudo scp -i ansible_instance_d**_****.pem "local_path_to_file" "ubuntu@ec2-**-***-**-***.compute-1.amazonaws.com:/remote_path_to_file"

Minus all the quotes of course.

Regards

Gull04
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying files from laptop to remote server using SSH

Hello, I'm sorry if this sounds like a very simple question, but I'm having some difficulty with it being a complete newbie to UNIx. I use Windows, and always have, but need some UNIX access for work, picking up files from our group space, etc. Basically, I'm using Cygwin and can SSH into the... (3 Replies)
Discussion started by: patwa
3 Replies

2. UNIX for Dummies Questions & Answers

Copying files from a remote server to local system with cygwin

Hi. I'm sorry if I get on people's nerves asking this, but I don't really understand how to do this and unfortunately don't have the time to work through it step by step in books, etc. At University, we have a unix server that hosts our files. we each have a login and password to access it. I... (3 Replies)
Discussion started by: patwa
3 Replies

3. Shell Programming and Scripting

ssh text into file on remote server

Hello, I have about 90 servers that I need to update snmp configs. I am trying to write a script that will echo 4 new lines of text into the snmpd.conf file. I have tested it locally and it works when the server ssh into itself but when I try to run the script to ssh into a remote server it logs... (5 Replies)
Discussion started by: mr_dthomas
5 Replies

4. Shell Programming and Scripting

Append Text To Remote Servers File Via SSH

Gentleman & Ladies, Please make me feel like and novice and explain why this is not working? I am attempting to ssh to a remote server via ssh and keys. I want to inject a file on the remote server with text. I am not achieving this. I would like to echo/inject the text on the remote... (1 Reply)
Discussion started by: abacus
1 Replies

5. Solaris

how to login with ssh to remote system with out applying the remote root/usr password

how to login with ssh to remote system with out applying the remote root/user password with rlogin we can ujse .rhosts file but with ssh howits possible plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

6. Shell Programming and Scripting

Running remote system shell script and c binary file from windows machine using java

Hi, I have an shell script program in a remote linux machine which will do some specific monitoring functionality. Also, have some C executables in that machine. From a windows machine, I want to run the shell script program (If possible using java). I tried with SSH for this. but, in... (1 Reply)
Discussion started by: ram.sj
1 Replies

7. UNIX for Dummies Questions & Answers

Copying text from Windows to AIX - missing text?

Hi All, I'm hoping this is an easy question, but I'm having a weird problem trying to simply copy and paste text from MS Windows (XP) Notepad and then pasting into vi or vim in AIX. When I type "oslevel" I get "5.3.0.0". The problem is that once the text is pasted, there are sections of text... (2 Replies)
Discussion started by: PlainInverted
2 Replies

8. UNIX for Dummies Questions & Answers

Copying from remote SunOS to local Windows 7 computer

Can someone please help me with copying from remote computer to local computer? I have Winscp installed but for some reason i can seem to get into the server using winscp. I am currently logged on to the server, so its not a case of remote host unavailable. I really am not sure if the syntax... (2 Replies)
Discussion started by: dollypee
2 Replies

9. Red Hat

Disable copying secure key's to remote system

Hi, We all know as we can connect remote system through ssh without entering username and password by copy the public key to remote host using ssh-copy-id. But my query is to i want to restrict the user as do not implement this feature.Whenever he is trying to login, he has to enter his/her... (1 Reply)
Discussion started by: mastansaheb
1 Replies

10. IP Networking

Unable to SSH from Windows client to Ubuntu Server

I'm trying to setup a small home network environment as a pet project. These are physical machines nothing virtual. Any help or ideas is greatly appreciated. I can ping between both machines and I have Samba established and can read/write different shares. When I try to SSH from Windows 8.1... (10 Replies)
Discussion started by: lombardi4851
10 Replies
scp(1)								   User Commands							    scp(1)

NAME
scp - secure copy (remote file copy program) SYNOPSIS
scp [-pqrvBC46] [-F ssh_config] [-S program] [-P port] [-c cipher] [-i identity_file] [-o ssh_option] [ [user@]host1:]file1 []... [ [user@]host2:]file2 DESCRIPTION
The scp utility copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication. Any file name may contain a host and user specification to indicate that the file is to be copied to/from that host. Copies between two remote hosts are permitted. OPTIONS
The following options are supported: -4 Forces scp to use IPv4 addresses only. -6 Forces scp to use IPv6 addresses only. -B Selects batch mode. (Prevents asking for passwords or passphrases.) -c cipher Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1). -C Compression enable. Passes the -C flag to ssh(1) to enable compression. -F ssh_config Specifies an alternative per-user configuration file for ssh(1.). -i identity_file Selects the file from which the identity (private key) for RSA authentication is read. This option is directly passed to ssh(1). -o ssh_option The given option is directly passed to ssh(1). -p Preserves modification times, access times, and modes from the original file. -P port Specifies the port to connect to on the remote host. Notice that this option is written with a capital `P', because -p is already reserved for preserving the times and modes of the file in rcp(1). -q Disables the progress meter. -r Recursively copies entire directories. -S program Specifies the name of the program to use for the encrypted connection. The program must understand ssh(1) options. -v Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging con- nection, authentication, and configuration problems. OPERANDS
The following operands are supported: host1, host2,... The name(s) of the host from or to which the file is to be copied. file1, file2,... The file(s) to be copied. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsshu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
rcp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), sshd(1M), ssh_config(4), attributes(5) NOTES
Generally, use of scp with password or keyboard-interactive authentication method and two remote hosts does not work. It does work with either the pubkey, hostbased or gssapi-keyex authentication method. For the pubkey authentication method, either private keys not pro- tected by a passphrase, or an explicit ssh agent forwarding have to be used. The gssapi-keyex authentication method works with the ker- beros_v5 GSS-API mechanism, but only if the GSSAPIDelegateCredentials option is enabled. SunOS 5.11 22 Jun 2007 scp(1)
All times are GMT -4. The time now is 01:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy