lftp script no longer works
I'm on Ubuntu 12.04 and have been using a script to automatically upload images to my Phocagallery directory in my account.
Below is the basic script:
read -p " Press the [Enter] key continue..."
lftp -c "set ftp:list-options -a;
open -u username,pass -p 18765 sftp://siteground144.com;
mirror --reverse \
--exclude-glob a-dir-to-exclude/ \
--exclude-glob a-file-to-exclude \
--exclude-glob a-file-group-to-exclude* \
mv /home/grouchygaijin/Pictures/Phoca_upload/* /media/Elements/"Image Staging"/
Of course in the actual script, I have my username and the real destination path.
The problem is that starting last week, if I click on the launcher I made to run the script I get an error:
delaying before reconnect...
The really weird thing is that if I open a terminal and type the name of the script to run it, about 80% of the time the script will run as it should. The other 20% of the time I get the same delaying before reconnect error.
Do any of you SiteGround Gurus have an idea of what is happening?
I'd really like to get my script working again.
I would really appreciate any help I could get. Am I the only person using a script to upload to the server from a Linux machine?
I thought I had solved the problem by running ssh-add /home/john/.ssh/private_key_unconverted
That is after I ran this command yesterday the script worked when I typed in the name of the script in the terminal.
Today Ubuntu had some updates so I ran the updates which updated the kernel and rebooted.
After reboot, the script would not work from the launcher I created to run it.
Furthermore it would not work when called directly from the terminal either.
(I have no idea why this should make a difference since the launcher specifically says to open gnome-terminal and run the script.)
So anyway, not knowing what to do I ran ssh-add /home/john/.ssh/private_key_unconverted again.
Now the script once again works if I open a terminal and type Phoca_upload.
If however, I run the script by clicking the quick list (launcher) in Ubuntu's dock like thing can not connect.
The error message is:
---- Running connect program (ssh -a -x -s -l <my user name is here> -p 18765 siteground144.com sftp)
---> sending a packet, length=5, type=1(INIT), id=0
<--- Permission denied (publickey).
**** Peer closed connection
I went to SG tech support and they couldn't figure out what is meant by the error publickey.
I created my key from the SG control panel and have it saved in my ~/.ssh directory.
Does anyone have an idea of what could be wrong or a better way to do this?
Thank you :-)
The error message means that when trying to establish the connection, no valid authentication method is used. In the case with SiteGround you are allowed to use sftp/ssh only if you are authenticated with a private SSH key generated for your account. All you need to do is make sure that running this script will add your private SSH key and you will be able to accomplish the upload without any problems.
Since the issue occurred after Ubuntu updated, I presume there is some change in the way the launcher executes the script and does not take the loaded SSH key into account. I would advise you to check the Ubuntu support forums for more information there.
Hi Guys, I'm on Ubuntu 12.04 and have been using a script to automatically upload images to my Phocagallery directory in my account.
Find great deals on eBay for Mac Laptop Charger in Laptop Power Adapters and Chargers. Shop with confidence.
By GrouchyGaijin in forum Hosting Related Questions
Last Post: 04-13-2013, 05:08 PM
By Vashnik in forum Customers' experience and suggestions
Last Post: 03-05-2012, 08:38 AM
By Lojadoca in forum Shopping Carts
Last Post: 08-04-2008, 02:32 AM
By westie in forum Other Software and Applications
Last Post: 07-16-2008, 09:22 AM
By FaraJoomla in forum General Joomla Discussions
Last Post: 09-08-2006, 06:54 AM
Tags for this Thread
Copyright © 2012 SiteGround.com Inc