Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scp with user/password@server

Status
Not open for further replies.

rohvar2005

Programmer
Feb 13, 2012
3
0
0
US
Hi All,

I need to copy files to a sftp.server.com using scp command.

User name: user321\windows20
Password: Pass$4354
Server" sftp.server.com

I would appreciate if some could help me with the syntax for this. I am trying to use user321\windows20:pass$4354@sftp.server.com but i am getting an error.
It appears that I have an issue with the special characters in the command.

Regards,
Rohvar

 
I have an issue with the special characters in the command
What is the real code of the whole command ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,

Can you help in more detail.

Regards,
Rohvar
 
simple way is to create shared key in the client and place the public key on the server then its as easy as

scp <filename> user@host:/path/to/storage/<filename>

So steps to create keys:

on client

1) cd .ssh
2) ssh-keygen -t ida
3) accept defaults presented and just <CR> so no passphrase
4) move new ida.pub key to server >> scp ida.pub user@host:.ssh/authorized_keys
5) check on server that authorized_keys now exists and is -r------ for owner only

Then just test the login with ssh user@host .. you should just drop in without prompts for password. Or scp test_file user@host:

(one rider is that server should allow key access but usually they do)

I hope that helps

Laurie.
 
Have you tried escaping the special characters?

Code:
user321[red]\[/red]\windows20:Pass[red]\[/red]$4354@sftp.server.com

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Hi Laurie,

Unfortunately the reomote client is not ready to create the secure keys. So we do not have a choice. Pelase help.

Regards,
Rohvar
 
Again, what is your actual code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
This really should be done with secure keys as previously detailed
not just to make the script easier to write but for security and maintainability.

Not only will you need the user name & password in the script which is a bad idea, if the password is ever changed (perhaps because of security concerns on the server) then the script(s) will have to be rewritten.


you should try to convince the remote client that things need to be done properly from day one.

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top