Unix/Linux Go Back    


Shell Programming and Scripting 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

Shell Programming and Scripting


Tags
rsync

Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 05-20-2008   -   Original Discussion by JCR
JCR's Unix or Linux Image
JCR JCR is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 7 August 2010, 10:23 AM EDT
Posts: 52
Thanks: 5
Thanked 0 Times in 0 Posts
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:


Code:
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
Sponsored Links
    #9  
Old Unix and Linux 05-20-2008   -   Original Discussion by JCR
ripat's Unix or Linux Image
ripat ripat is offline Forum Advisor  
Registered User
 
Join Date: Oct 2006
Last Activity: 27 March 2017, 3:00 AM EDT
Location: Belgium
Posts: 544
Thanks: 5
Thanked 42 Times in 29 Posts
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.
Sponsored Links
    #10  
Old Unix and Linux 05-20-2008   -   Original Discussion by JCR
JCR's Unix or Linux Image
JCR JCR is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 7 August 2010, 10:23 AM EDT
Posts: 52
Thanks: 5
Thanked 0 Times in 0 Posts
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 Unix and Linux 05-20-2008   -   Original Discussion by JCR
ripat's Unix or Linux Image
ripat ripat is offline Forum Advisor  
Registered User
 
Join Date: Oct 2006
Last Activity: 27 March 2017, 3:00 AM EDT
Location: Belgium
Posts: 544
Thanks: 5
Thanked 42 Times in 29 Posts
Login as root and:
# su apache

$ ssh-keygen -t rsa

Leave the pass phrase empty.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rsync Help? Russell P UNIX for Dummies Questions & Answers 2 08-08-2011 06:20 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
Bash rsync but move not delete Movomito Shell Programming and Scripting 1 04-30-2008 05:37 PM
Rsync darknite87 UNIX for Advanced & Expert Users 1 06-06-2002 04:37 PM



All times are GMT -4. The time now is 04:27 AM.