Sponsored Content
Operating Systems Linux Setting Up Google 2F Authentication for Automated (Crontab) rsync Post 303038370 by Neo on Sunday 1st of September 2019 04:15:29 AM
Old 09-01-2019
Setting Up Google 2F Authentication for Automated (Crontab) rsync

Dear All,

I have Google Two Factor (2F) Authentication enabled for sshd on most of my Linux servers. This works well and I highly recommend it.

My question is:

Has anyone set this up for rsync which runs in a crontab?

For example, supposed we have this simple crontab script:

Code:
/usr/bin/rsync -qpavzh --rsh="/usr/bin/sshpass -f '/var/local/.secure' ssh -o StrictHostKeyChecking=no -l user" user@myserver.com:/var/data/dumps/ /var/data/dumps/

This works fine, of course, when syncing some backup files across the net without 2FA; but I want to do the same thing using Google Authenticator for 2FA.

Has anyone set this up on any of their servers?

Thanks.
This User Gave Thanks to Neo For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting crontab

Hey all, I would like to know how to set a cron job to run from 8:15 am to 4:00 pm? Or do I have to do this in 2 seperates cron? Thanks! (4 Replies)
Discussion started by: mpang_
4 Replies

2. Linux

Setting up crontab, still cant get it to work

OK I have been working on this simple action for a while and I cannot get it to work. First off im new to the linux command line world. I feel like I am missing something simple. What I am trying to achieve is that I want this command: tcpdump -s2000 -w'flowroute-%H%M.pcap' -G900 -W36 &to... (13 Replies)
Discussion started by: Nasasdge
13 Replies

3. Shell Programming and Scripting

Crontab setting error

Hi All, I have created crontab using following steps- 1) crontab -e (edited the file with) 0 10 * * 1-5 /home/user01/exercise/cron.sh 2) then saved this file with :wq 3) cron.sh contains the code- #!/bin/bash DAY=`date +%a` mkdir abc_${DAY} 4) done the execut permision... (3 Replies)
Discussion started by: pspriyanka
3 Replies

4. UNIX for Dummies Questions & Answers

Need some help on setting up rsync

I need to "sync" a directory from a prod server to a test server. Rsync is working but it prompts for a password and I'd like to automate the process. The directory on the prod/source server is owned by root, and some subdirectories are only readable by root. On the test/destination servers, I can... (1 Reply)
Discussion started by: LAToro
1 Replies

5. UNIX for Advanced & Expert Users

Error while running Rsync through Crontab

hi All, i have implemented Rsync in my source and destination server. while running through command prompt it is working fine: ksh rsync_bravo_db.ksh usa0300uz1252.apps.mc.xerox.com /uv1402/u207/home/bravodba/bin/rsync-3.0.9/config/mrsx_rsync.cfg but later on i created a another ksh and... (4 Replies)
Discussion started by: lovelysethii
4 Replies

6. UNIX for Dummies Questions & Answers

Crontab setting

Hi Team, Please help me to set one script in crontab. I have one script and inside script, its creating one log file for saving ouptut of script. i have to out that script in crontab. When i put the script in cronatab, it executed and log file created but no data in log. like this i put in... (3 Replies)
Discussion started by: shivshankar
3 Replies

7. Linux

Trouble setting up basic user authentication on apache2 web server

Hey guys! So I decided to set up some basic user authentication on my apache2 server, and I am running into some problems. I followed the documentation provided by apache on their website, but I cant create the password file for some reason. I did a little trouble shooting myself, and found... (40 Replies)
Discussion started by: LinuxIntern445
40 Replies

8. Shell Programming and Scripting

Crontab setting

Hi All, Can anyone tell me how to schedule the dbshell.sh script to run on sunday. I have scheduled as 1 19 7 * * /home/svr/dbshell.sh. kindly confirm confirm whether coded "7" or it should set to '0'. unix:$ crontab -l 0 19 6 * * /home/svr/dbemail.sh 1 19 7 * * /home/svr/dbshell.sh (2 Replies)
Discussion started by: arun888
2 Replies

9. UNIX for Advanced & Expert Users

Crontab authentication failure

Dear all, I noticed in syslog that i receive authentication failure from cron: Mar 11 23:19:01 s1 CRON28789]: Authentication failure Mar 11 23:19:01 s1 cron: Authentication failure Mar 11 23:19:01 s1 cron: Authentication failure Mar 11 23:19:01 s1 CRON: Authentication failure Mar 11... (3 Replies)
Discussion started by: mydove
3 Replies
CRONTAB(1)						    BSD General Commands Manual 						CRONTAB(1)

NAME
crontab -- maintain crontab files for individual users (V3) SYNOPSIS
crontab [-u user] file crontab [-u user] { -l | -r | -e } DESCRIPTION
The crontab utility is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var, they are not intended to be edited directly. If the allow file exists, then you must be listed therein in order to be allowed to use this command. If the allow file does not exist but the deny file does exist, then you must not be listed in the deny file in order to use this command. If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command. The format of these files is one username per line, with no leading or trailing whitespace. Lines of other formats will be ignored, and so can be used for comments. The first form of this command is used to install a new crontab from some named file or standard input if the pseudo-filename '-' is given. The following options are available: -u Specify the name of the user whose crontab is to be tweaked. If this option is not given, crontab examines ``your'' crontab, i.e., the crontab of the person executing the command. Note that su(1) can confuse crontab and that if you are running inside of su(1) you should always use the -u option for safety's sake. -l Display the current crontab on standard output. -r Remove the current crontab. -e Edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. The specified editor must edit the file in place; any editor that unlinks the file and recreates it cannot be used. After you exit from the editor, the modified crontab will be installed automatically. FILES
/var/cron/allow List of users allowed to use crontab /var/cron/deny List of users prohibited from using crontab /var/cron/tabs Directory for personal crontab files DIAGNOSTICS
A fairly informative usage message appears if you run it with a bad command line. SEE ALSO
crontab(5), cron(8) STANDARDS
The crontab command conforms to IEEE Std 1003.2 (``POSIX.2'') with the exception that the dangerous variant of calling crontab without a file name in the first form of the command is not allowed by this implementation. The pseudo-filename '-' must be specified to read from standard input. The new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax. AUTHORS
Paul Vixie <paul@vix.com> BSD
May 13, 2010 BSD
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy