rsync: can't get rid of password prompt The 2019 Stack Overflow Developer Survey Results Are...
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Time travel alters history but people keep saying nothing's changed
In microwave frequencies, do you use a circulator when you need a (near) perfect diode?
Why do UK politicians seemingly ignore opinion polls on Brexit?
Geography at the pixel level
Is three citations per paragraph excessive for undergraduate research paper?
It's possible to achieve negative score?
Monty Hall variation
If the Wish spell is used to duplicate the effect of Simulacrum, are existing duplicates destroyed?
Does a dangling wire really electrocute me if I'm standing in water?
If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?
Should I write numbers in words or as numerals when there are multiple next to each other?
Should I use my personal or workplace e-mail when registering to external websites for work purpose?
What does "sndry explns" mean in one of the Hitchhiker's guide books?
Carnot-Caratheodory metric
Does light intensity oscillate really fast since it is a wave?
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Inline version of a function returns different value then non-inline version
What is the steepest angle that a canal can be traversable without locks?
Does it makes sense to buy a new cycle to learn riding?
Inflated grade on resume at previous job, might former employer tell new employer?
What is the use of option -o in the useradd command?
How was Skylab's orbit inclination chosen?
Are USB sockets on wall outlets live all the time, even when the switch is off?
rsync: can't get rid of password prompt
The 2019 Stack Overflow Developer Survey Results Are InIs it possible to detach a process from its terminal? (Or, “I should have used screen!”)rsync with script supplied passwordRsync when run in cron doesnt work. Rsync between Mac Os x Server and Linux Centosrsync permission problemsHow do I get rsync to listen on two different ports via xinetd?rsync without password, none of google (server fault) tutorials workedHow to prevent rsync (using ssh as remote shell) from facing a password promptUbuntu 14.04 - rsync corrupting SSH configs/keys?Rsync with ssh and root not working after change hosts IPHow do i enable to prompt password for default SSH user for sudo commands
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm trying to run rsync to copy files (Centos 5.2 -> Centos 5.2) and I need run using nohup it so it can run after I disconnect my ssh session. The problem is I cannot get rsync to not prompt for a passowrd, and I cannot get nohup to play nice with the password prompt.
rsync -v -r -x --password-file=/root/password.txt /sourcedir/ root@10.1.1.1:/destdir
I've tried both setting the RSYNC_PASSWORD variable to the password and creating a file with the password and using --password-file, but in both those case I still get the prompt asking for the password.
How do I give rsync the password it needs to it will run happily?
linux rsync
add a comment |
I'm trying to run rsync to copy files (Centos 5.2 -> Centos 5.2) and I need run using nohup it so it can run after I disconnect my ssh session. The problem is I cannot get rsync to not prompt for a passowrd, and I cannot get nohup to play nice with the password prompt.
rsync -v -r -x --password-file=/root/password.txt /sourcedir/ root@10.1.1.1:/destdir
I've tried both setting the RSYNC_PASSWORD variable to the password and creating a file with the password and using --password-file, but in both those case I still get the prompt asking for the password.
How do I give rsync the password it needs to it will run happily?
linux rsync
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago
add a comment |
I'm trying to run rsync to copy files (Centos 5.2 -> Centos 5.2) and I need run using nohup it so it can run after I disconnect my ssh session. The problem is I cannot get rsync to not prompt for a passowrd, and I cannot get nohup to play nice with the password prompt.
rsync -v -r -x --password-file=/root/password.txt /sourcedir/ root@10.1.1.1:/destdir
I've tried both setting the RSYNC_PASSWORD variable to the password and creating a file with the password and using --password-file, but in both those case I still get the prompt asking for the password.
How do I give rsync the password it needs to it will run happily?
linux rsync
I'm trying to run rsync to copy files (Centos 5.2 -> Centos 5.2) and I need run using nohup it so it can run after I disconnect my ssh session. The problem is I cannot get rsync to not prompt for a passowrd, and I cannot get nohup to play nice with the password prompt.
rsync -v -r -x --password-file=/root/password.txt /sourcedir/ root@10.1.1.1:/destdir
I've tried both setting the RSYNC_PASSWORD variable to the password and creating a file with the password and using --password-file, but in both those case I still get the prompt asking for the password.
How do I give rsync the password it needs to it will run happily?
linux rsync
linux rsync
edited Jul 6 '10 at 10:35
splattne
25.7k1891144
25.7k1891144
asked Jul 6 '10 at 8:27
DrStalkerDrStalker
3,211206699
3,211206699
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago
add a comment |
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago
add a comment |
4 Answers
4
active
oldest
votes
You can use public/pricate key authentication.
Generate a pair public/private key with
ssh-keygen -t rsa
then copy dsa.pub into .ssh/authorized_keys file in your home directory in the destiny host.
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
add a comment |
The problem is that RSYNC_PASSWORD as well as --password-file only is applicable when connecting directly to a rsyncd server, not when spawning rsync using a remote shell such as ssh. Your choices are, depending on the data you are transferring, to either to setup password-less ssh keys or to start using a rsyncd daemon instead.
(Note that if you connect directly to a rsyncd then your data will be transfered unencrypted.)
add a comment |
Alternatively you could use screen instead of nohup. It works like this :
- type
screen
- you will be presented with a new terminal
- start you're command that will take forever, the rsync command in your case.
- disconnect from your screen terminal with
ctrl-a
, followed by d - you can exit now or do other stuff, your screen terminal will go on doing your stuff
- you can reconnect to screen, by typing
screen -r
, this alose works from another tty or ssh connection or whatever.
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
add a comment |
I would also start with what @Jasper recommends, or if you need run the command "from" the remote server, and you are running commands from target or elsewhere, then first run this:
ssh -t user@10.1.999.3 screen -DRO
Then, adjust your rsync command as follows:
rsync -v -r -x 'ssh -i /path/to/.ssh/id_rsa' /sourcedir/ root@10.1.1.1:/destdir
As long as the destination 10.1.1.1
has the public key for the private key you specified in the syntax above, you you should be fine. If it does not, send it over using ssh-copy-id
.
Also, I now always use -avWeqr
when sending over network, as that was needed for me in order to get --delete
working properly with all the other parameters. The syntax I gave you works on Debian 9.7
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f157740%2frsync-cant-get-rid-of-password-prompt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use public/pricate key authentication.
Generate a pair public/private key with
ssh-keygen -t rsa
then copy dsa.pub into .ssh/authorized_keys file in your home directory in the destiny host.
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
add a comment |
You can use public/pricate key authentication.
Generate a pair public/private key with
ssh-keygen -t rsa
then copy dsa.pub into .ssh/authorized_keys file in your home directory in the destiny host.
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
add a comment |
You can use public/pricate key authentication.
Generate a pair public/private key with
ssh-keygen -t rsa
then copy dsa.pub into .ssh/authorized_keys file in your home directory in the destiny host.
You can use public/pricate key authentication.
Generate a pair public/private key with
ssh-keygen -t rsa
then copy dsa.pub into .ssh/authorized_keys file in your home directory in the destiny host.
edited Nov 8 '16 at 15:11
answered Jul 6 '10 at 8:38
MaxferMaxfer
19010
19010
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
add a comment |
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
2
2
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
Mandatory reading: ibm.com/developerworks/library/l-keyc.html
– Ignacio Vazquez-Abrams
Jul 6 '10 at 8:52
add a comment |
The problem is that RSYNC_PASSWORD as well as --password-file only is applicable when connecting directly to a rsyncd server, not when spawning rsync using a remote shell such as ssh. Your choices are, depending on the data you are transferring, to either to setup password-less ssh keys or to start using a rsyncd daemon instead.
(Note that if you connect directly to a rsyncd then your data will be transfered unencrypted.)
add a comment |
The problem is that RSYNC_PASSWORD as well as --password-file only is applicable when connecting directly to a rsyncd server, not when spawning rsync using a remote shell such as ssh. Your choices are, depending on the data you are transferring, to either to setup password-less ssh keys or to start using a rsyncd daemon instead.
(Note that if you connect directly to a rsyncd then your data will be transfered unencrypted.)
add a comment |
The problem is that RSYNC_PASSWORD as well as --password-file only is applicable when connecting directly to a rsyncd server, not when spawning rsync using a remote shell such as ssh. Your choices are, depending on the data you are transferring, to either to setup password-less ssh keys or to start using a rsyncd daemon instead.
(Note that if you connect directly to a rsyncd then your data will be transfered unencrypted.)
The problem is that RSYNC_PASSWORD as well as --password-file only is applicable when connecting directly to a rsyncd server, not when spawning rsync using a remote shell such as ssh. Your choices are, depending on the data you are transferring, to either to setup password-less ssh keys or to start using a rsyncd daemon instead.
(Note that if you connect directly to a rsyncd then your data will be transfered unencrypted.)
answered Jul 6 '10 at 10:28
andolandol
6,3142240
6,3142240
add a comment |
add a comment |
Alternatively you could use screen instead of nohup. It works like this :
- type
screen
- you will be presented with a new terminal
- start you're command that will take forever, the rsync command in your case.
- disconnect from your screen terminal with
ctrl-a
, followed by d - you can exit now or do other stuff, your screen terminal will go on doing your stuff
- you can reconnect to screen, by typing
screen -r
, this alose works from another tty or ssh connection or whatever.
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
add a comment |
Alternatively you could use screen instead of nohup. It works like this :
- type
screen
- you will be presented with a new terminal
- start you're command that will take forever, the rsync command in your case.
- disconnect from your screen terminal with
ctrl-a
, followed by d - you can exit now or do other stuff, your screen terminal will go on doing your stuff
- you can reconnect to screen, by typing
screen -r
, this alose works from another tty or ssh connection or whatever.
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
add a comment |
Alternatively you could use screen instead of nohup. It works like this :
- type
screen
- you will be presented with a new terminal
- start you're command that will take forever, the rsync command in your case.
- disconnect from your screen terminal with
ctrl-a
, followed by d - you can exit now or do other stuff, your screen terminal will go on doing your stuff
- you can reconnect to screen, by typing
screen -r
, this alose works from another tty or ssh connection or whatever.
Alternatively you could use screen instead of nohup. It works like this :
- type
screen
- you will be presented with a new terminal
- start you're command that will take forever, the rsync command in your case.
- disconnect from your screen terminal with
ctrl-a
, followed by d - you can exit now or do other stuff, your screen terminal will go on doing your stuff
- you can reconnect to screen, by typing
screen -r
, this alose works from another tty or ssh connection or whatever.
answered Jul 6 '10 at 9:32
JasperJasper
1,022810
1,022810
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
add a comment |
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
1
1
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
Or you could just use a ssh key.
– Ignacio Vazquez-Abrams
Jul 6 '10 at 9:34
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
There are instances where we must backup or otherwise automate file transfers from systems which are legacy, or for whatever reason do not support SSH keys.
– Charlie Schliesser
Dec 11 '12 at 20:59
add a comment |
I would also start with what @Jasper recommends, or if you need run the command "from" the remote server, and you are running commands from target or elsewhere, then first run this:
ssh -t user@10.1.999.3 screen -DRO
Then, adjust your rsync command as follows:
rsync -v -r -x 'ssh -i /path/to/.ssh/id_rsa' /sourcedir/ root@10.1.1.1:/destdir
As long as the destination 10.1.1.1
has the public key for the private key you specified in the syntax above, you you should be fine. If it does not, send it over using ssh-copy-id
.
Also, I now always use -avWeqr
when sending over network, as that was needed for me in order to get --delete
working properly with all the other parameters. The syntax I gave you works on Debian 9.7
add a comment |
I would also start with what @Jasper recommends, or if you need run the command "from" the remote server, and you are running commands from target or elsewhere, then first run this:
ssh -t user@10.1.999.3 screen -DRO
Then, adjust your rsync command as follows:
rsync -v -r -x 'ssh -i /path/to/.ssh/id_rsa' /sourcedir/ root@10.1.1.1:/destdir
As long as the destination 10.1.1.1
has the public key for the private key you specified in the syntax above, you you should be fine. If it does not, send it over using ssh-copy-id
.
Also, I now always use -avWeqr
when sending over network, as that was needed for me in order to get --delete
working properly with all the other parameters. The syntax I gave you works on Debian 9.7
add a comment |
I would also start with what @Jasper recommends, or if you need run the command "from" the remote server, and you are running commands from target or elsewhere, then first run this:
ssh -t user@10.1.999.3 screen -DRO
Then, adjust your rsync command as follows:
rsync -v -r -x 'ssh -i /path/to/.ssh/id_rsa' /sourcedir/ root@10.1.1.1:/destdir
As long as the destination 10.1.1.1
has the public key for the private key you specified in the syntax above, you you should be fine. If it does not, send it over using ssh-copy-id
.
Also, I now always use -avWeqr
when sending over network, as that was needed for me in order to get --delete
working properly with all the other parameters. The syntax I gave you works on Debian 9.7
I would also start with what @Jasper recommends, or if you need run the command "from" the remote server, and you are running commands from target or elsewhere, then first run this:
ssh -t user@10.1.999.3 screen -DRO
Then, adjust your rsync command as follows:
rsync -v -r -x 'ssh -i /path/to/.ssh/id_rsa' /sourcedir/ root@10.1.1.1:/destdir
As long as the destination 10.1.1.1
has the public key for the private key you specified in the syntax above, you you should be fine. If it does not, send it over using ssh-copy-id
.
Also, I now always use -avWeqr
when sending over network, as that was needed for me in order to get --delete
working properly with all the other parameters. The syntax I gave you works on Debian 9.7
answered 8 mins ago
oemb1905oemb1905
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f157740%2frsync-cant-get-rid-of-password-prompt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you did not specify where your public key was in the rsync command - if you do this, and presuming you properly set up ssh with public key authentication, you will no longer get a password prompt. Also, I provided some syntax for screen to expand on some answers below. Hope this helps.
– oemb1905
4 mins ago