Linux – Using a system user to transfer files via scp/kerberos

centoscronkerberoslinuxscp

I need a cron job to transfer a file across servers using scp and kerberos authentication. The system user for the job is in /etc/passwd on both machines and a valid keytab has been created (with -randkey) for the kerberos auth. The cron job script calls kinit, then scp, then kdestroy. However, the scp won't work unless I change the /sbin/nologin in /etc/passwd to a valid shell, say /bin/bash.

Question #1: is this a security hole to specify a shell?
Question #2: is this the "right" way to do this?

Thanks in advance

Best Answer

Answer 1: It may be. If you'd disable any other authentication method, and therefore forced use of the key and you believe this key to be strong, then a

Answer 2: With no valid shell scp will drop session before it transfers any files, which is a shame. It seems that scponly does what you want (http://www.sublimation.org/scponly/wiki/index.php/Main_Page).