Today's Posts

BSD, Linux, and UNIX shell scripting Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

rsync bash php

bash, php, rsync, shell scripts

Login to Reply

Thread Tools Search this Thread
# 8  
Old 05-20-2008
The user is apache and finger apache returns
Login: apache Name: Apache
Directory: /var/www Shell: /sbin/nologin
Never logged in.
No mail.
No Plan.
I did:
cd /var/www
cp -R ~/.ssh ./
chown -R apache .ssh
chgrp -R apache .ssh

but apache is still unable to find those keys when calling the php script. I am using an apache virtual host and I copied that same .ssh folder to the DocumentRoot without better results.
Any idea?
Thank you

Last edited by Yogesh Sawant; 12-10-2010 at 06:00 AM.. Reason: added code tags
# 9  
Old 05-20-2008
On the target server you need to create also a ./var/www/.ssh/ directory that should contain the authorized_keys file in which you should add the user "apache" public key.

Instead of copying the root keys or any other key, I would rather create a new set of key with ssh-keygen command under apache user. Transfer the public key to the target server and add that key to the /var/www/.ssh/authorized_keys file.
# 10  
Old 05-20-2008
Thank you for the answer. How do I create a new set of keys with ssh-keygen under he apache user? Do I need to login as apache? I am not sure where to find the password.
# 11  
Old 05-20-2008
Login as root and:
# su apache

$ ssh-keygen -t rsa

Leave the pass phrase empty.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rsync Error: rsync: link_stat failed: No such file or directory (2) mohtashims Shell Programming and Scripting 2 02-06-2018 10:21 AM
Passing variable from PHP to bash script kieranfoley Web Programming 10 12-09-2017 04:02 AM
PHP parametric + bash script combination baris35 Shell Programming and Scripting 6 07-06-2017 12:45 PM
Email Notifications on Cron Bash Error Only cp mv rsync consultant Shell Programming and Scripting 1 02-04-2017 11:33 AM
Rsync in bash script doesn't work even after placing pub key in target server jacobs.smith Shell Programming and Scripting 4 01-20-2015 06:57 PM
Technical questions on bash,mysql and pHp John_Peter Shell Programming and Scripting 2 03-14-2014 03:07 AM
Rsync script to rewrite suffix - BASH, awk, sed, perl? jmituzas Shell Programming and Scripting 1 03-26-2013 04:58 PM
Passing variables from bash to php-cli robbee Shell Programming and Scripting 0 05-09-2011 02:42 PM
Integrating bash script into php (page) xerox UNIX for Dummies Questions & Answers 1 03-02-2011 09:00 AM
bash script + php mrowcp Shell Programming and Scripting 1 09-05-2010 04:21 PM
[BASH] rsync - error on destination PaganoM Shell Programming and Scripting 0 03-20-2010 07:59 AM
Bash script to back up with rsync ajmoreti Shell Programming and Scripting 3 11-16-2009 06:36 AM
can't executed bash from PHP.. ridwanfi Shell Programming and Scripting 2 04-29-2009 06:13 AM
Exec bash shell via PHP Site ! lamthenhan Shell Programming and Scripting 1 07-22-2008 08:17 AM
Bash rsync but move not delete Movomito Shell Programming and Scripting 1 04-30-2008 05:37 PM

All times are GMT -4. The time now is 12:12 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
Show Password