Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-30-2007, 09:20 PM   #1
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 168

Rep: Reputation: 30
Writing to a remote machine without password

I'm setting up a system that will transfer files
without a password.

I created pair of keys on COMPUTER1.
Moved the public key to COMPUTER2 and added it to /root/.ssh/authorized_keys

Now what do I need to do next for COMPUTER2 to allow COMPUTER1 to write to a particular folder on COMPUTER2.

Example I want to do something like this:

scp /home/user/filename user@COMPUTER2:/home/user/

In other words, write the file "/home/user/filename" to "/home/user/" on COMPUTER2.

Old 11-30-2007, 10:26 PM   #2
LQ Newbie
Registered: Nov 2007
Posts: 22

Rep: Reputation: 15
With the public key from root@COMPUTER1 placed in COMPUTER2:/root/.ssh/authorized_keys, you should be able to use almost exactly your desired command, just change:

scp /home/user/filename user@COMPUTER2:/home/user/


scp /home/user/filename root@COMPUTER2:/home/user/

This reflects the fact that you've placed your public key in COMPUTER2:/root/.ssh/authorized_keys which gives you public key (vs password) access on COMPUTER2 as root (not user)

There's probably a gotcha here. While you'll be able to copy the file using the above, it will be created by and owned by root. The default permissions mean this file is likely unreadable, unwritable or both by user on COMPUTER2. If this isn't what you want, you may want to place the public key in ~user/.ssh/authorized_keys (/home/user/.ssh/authorized_keys) and then use your orignal command which then creates the file as user on COMPUTER2 (i.e. owned by user with default permissions.)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 01:21 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 01:23 PM
Complicated one: MySQL, rsync, remote machine, local machine daiver Linux - General 2 02-27-2006 01:14 PM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 08:39 PM
using linux to redirect remote vpn traffic to another remote machine brb5548 Linux - Networking 0 06-28-2003 10:07 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration