LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2013, 04:01 AM   #1
iris2gud
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
SU command not asking for password or integrate password in php code


i created a php script that needs to copy files from my server into a remote one. But I cannot make it work. I tested the su command via the unix shell and it is working but it is prompting first for the remote user password before executing the command. is it possible to include the password ex. "su username password -c 'cp /frommyserver /toremoteserver'"
 
Old 09-13-2013, 06:59 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
su is not really the tool to copy data to a remote host. You are better of with a tool like scp.

I presume you got ssh installed on the local and remote system and generated your keys.
You can then copy your public key to the remote machine with:

Code:
ssh-copy-id user@remote
After that you should be able to use
Code:
 
scp /localdir  user@remote:/remotedir
without the remote machine even asking for a password.

Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php code to change password asifbasha Linux - Server 3 06-24-2011 05:42 AM
[SOLVED] password code anil007523 Linux - Kernel 15 07-30-2010 01:11 PM
Compare LDAP password with php crypt password coolamit78 Linux - Networking 1 01-30-2006 06:35 AM
Password entry in C code zaichik Programming 1 02-01-2005 09:02 AM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration