rsync bash php


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting rsync bash php
# 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:
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
# 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 or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminal running bash/rsync script does not close with exit (MacOS High SIerra)

Hello, I am running a bash script to do an rsync back on a computer running MacOS High Sierra. This is the script I am using, #!/bin/bash # main backup location, trailing slash included backup_loc="/Volumes/Archive_Volume/00_macos_backup/" # generic backup function function backup {... (12 Replies)
Discussion started by: LMHmedchem
12 Replies

2. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

3. Shell Programming and Scripting

Email Notifications on Cron Bash Error Only cp mv rsync

Wondering if anyone can point me to an example of how to setup a bash script that executes cp mv and rsync commands and only sends an email if there were errors with any of those commands and what the errors are. In addition it should email if the cron event to execute the script fails, or in... (1 Reply)
Discussion started by: consultant
1 Replies

4. Shell Programming and Scripting

Rsync in bash script doesn't work even after placing pub key in target server

Hello Friends, My bash script is like this #!/bin/bash # request Bourne shell as shell for job #$ -S /bin/bash # assume current working directory as paths #$ -cwd #$ -N rsync-copy # # print date and time date rsync -rltD --progress "ssh -i /home/myname/.ssh/id_rsa"... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

5. Shell Programming and Scripting

Rsync script to rewrite suffix - BASH, awk, sed, perl?

trying to write up a script to put the suffix back. heres what I have but can't get it to do anything :( would like it to be name.date.suffix rsync -zrlpoDtub --suffix=".`date +%Y%m%d%k%M%S`.~" --bwlimit=1024 /mymounts/test1/ /mymounts/test2/ while IFS=. read -r -u 9 -d '' name... (1 Reply)
Discussion started by: jmituzas
1 Replies

6. Shell Programming and Scripting

bash script + php

Hello, I want to move some of my bash scripts to php ( add samba user, add new PC in dhcp and etc. ).With Google, I found some articles for bash and php, but there is only simple examples, nothing for variables. Example: #!/bin/bash status=`/usr/local/etc/rc.d/isc-dhcpd status` ############... (1 Reply)
Discussion started by: mrowcp
1 Replies

7. Shell Programming and Scripting

[BASH] rsync - error on destination

Hi everyone, and thanks to all for your assistance. I have a problem with the rsync command. I want to make a backup of a "source" directory in a "destination" directory. I want to specify: "absolute path of destination" (identified by a ~): ~/Destination or a "relative path of... (0 Replies)
Discussion started by: PaganoM
0 Replies

8. Shell Programming and Scripting

Bash script to back up with rsync

I'm trying to write a script to back up with rsync, the script I am posting below: nomServer="shiva horus isis" dirshiva="/etc /faturamento" shivaListExc="/usr/local/bin/shivaListExclRsync" dumpDir="$dumpFile/Shiva" dateBkp=`date +%A` for nServer in ${nomServer} do ... (3 Replies)
Discussion started by: ajmoreti
3 Replies

9. Shell Programming and Scripting

can't executed bash from PHP..

dear list, i've just write a simple php script to add user to my iptables, but some times it works and it dosn't work,, here's my script for my adduser.php <?php exec('/var/www/html/backup.sh'); $hash = "# $_POST\n"; $ip = "-A INPUT -p tcp -m tcp -s $_POST -d 10.10.105.18 --dport 8080 -j... (2 Replies)
Discussion started by: ridwanfi
2 Replies

10. Shell Programming and Scripting

Bash rsync but move not delete

There might be an easy solution to my problem, or maybe not, but here it is. I am trying to rsync a Volume with 1.5 terabytes of data and send it via fibre channel to a raid array. Now normally when I rsync it scans through everything and, before copying anything, deletes any files that have... (1 Reply)
Discussion started by: Movomito
1 Replies
Login or Register to Ask a Question