View previous topic :: View next topic |
Author |
Message |
lucapost Veteran
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Thu Dec 27, 2007 9:09 pm Post subject: curl e scp |
|
|
Sto provando ad imparare qualcosa su questo tools e sto cercando di fare l'upload di un file su un server ssh, questo è l'errore che ricevo:
Code: | ~> curl scp://lucapost@voltron/home/lucapost/message.txt
curl: (1) Protocol scp not supported or disabled in libcurl |
così cerco un pò sul web e scopro:
Code: |
~> curl-config --protocols
HTTP
HTTPS
FTP
FTPS
FILE
TELNET
DICT
TFTP |
come si abilita il protocollo SSH/SCP in curl? qualcuno ha esperienza?
Queste le USE: Code: |
~> equery uses curl
[ Searching for packages matching curl... ]
[ Colour Code : set unset ]
[ Legend : Left column (U) - USE flags from make.conf ]
[ : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for net-misc/curl-7.17.1 ]
U I
- - ares : Enabled c-ares dns support
- - gnutls : Adds support for net-libs/gnutls
- - idn : Enable support for Internationalized Domain Names
- - ipv6 : Adds support for IP version 6
- - kerberos : Adds kerberos support
- - ldap : Adds LDAP support (Lightweight Directory Access Protocol)
- - nss : Use NSS as the crypto engine
+ + ssl : Adds support for Secure Socket Layer connections
- - test : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore. |
_________________ LP |
|
Back to top |
|
|
morellik l33t
Joined: 03 Feb 2003 Posts: 629 Location: Firenze
|
Posted: Fri Dec 28, 2007 11:50 am Post subject: |
|
|
E' probabile che il developer che si occupa dell'ebuild di curl abbia notato dei problemi con il protocollo SSH. Per abilitare il supporto SCP/SFTP è infatti necessario compilare curl con --with-libssh2 ma se dai un'occhiata all'ebuild di curl troverai:
Code: |
IUSE="ssl ipv6 ldap ares gnutls nss idn kerberos test"
#IUSE="ssl ipv6 ldap ares gnutls libssh2 nss idn kerberos test"
.
.
# libssh2? ( >=net-libs/libssh2-0.16 )"
.
.
# net-libs/libssh2 (masked) --with-libssh2
.
.
.
--without-libssh2
|
Per cui curl viene compilato di default senza il supporto SCP/SFTP. |
|
Back to top |
|
|
Kernel78 Moderator
Joined: 24 Jun 2005 Posts: 3654
|
Posted: Fri Dec 28, 2007 12:37 pm Post subject: |
|
|
c'è un bug aperto (non su gentoo ma proprio su curl) relativo al supporto per ssh, forse è per questo motivo che è stato disabilitato ... _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
|
lucapost Veteran
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Sat Dec 29, 2007 9:53 am Post subject: |
|
|
Sembrava il tool adatto per gestire i file su server multiprotocollo... _________________ LP |
|
Back to top |
|
|
Kernel78 Moderator
Joined: 24 Jun 2005 Posts: 3654
|
Posted: Sat Dec 29, 2007 10:33 am Post subject: |
|
|
lucapost wrote: |
Sembrava il tool adatto per gestire i file su server multiprotocollo... |
Guardando il bug risulta chiuso quindi potresti provare a modificarti l'ebuild per prendere una delle ultime daily snapshot oppure aspetti che esca la nuova versione e ti fai un ebuild per quella (o chiedi su bugs.gentoo.org che venga fatto un version bump) _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
|
.:deadhead:. Advocate
Joined: 25 Nov 2003 Posts: 2963 Location: Milano, Italy
|
|
Back to top |
|
|
lucapost Veteran
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Wed Jan 02, 2008 11:08 pm Post subject: |
|
|
.:deadhead:. wrote: | Che cosa cambia rispetto ad usare scp direttamente? Quali sono i campi di applicazione di curl/ssh ? |
ed esempio supporta il resume, questo per me è già un ottimo motivo. _________________ LP |
|
Back to top |
|
|
Kernel78 Moderator
Joined: 24 Jun 2005 Posts: 3654
|
Posted: Thu Jan 03, 2008 12:55 pm Post subject: |
|
|
lucapost wrote: | .:deadhead:. wrote: | Che cosa cambia rispetto ad usare scp direttamente? Quali sono i campi di applicazione di curl/ssh ? |
ed esempio supporta il resume, questo per me è già un ottimo motivo. |
un tip che avevo trovato per il resume è di usare Code: | rsync --partial --rsh=ssh | se vuoi sapere a che punto è puoi anche aggiungere --progress _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
|
darkmanPPT Veteran
Joined: 13 Apr 2006 Posts: 1069 Location: vi/bo
|
Posted: Sat Aug 28, 2010 10:24 am Post subject: Re: curl e scp |
|
|
lucapost wrote: | Sto provando ad imparare qualcosa su questo tools e sto cercando di fare l'upload di un file su un server ssh, questo è l'errore che ricevo:
Code: | ~> curl scp://lucapost@voltron/home/lucapost/message.txt
curl: (1) Protocol scp not supported or disabled in libcurl |
|
ho trovato questo post cercando qua e là.
invogliato da questo intervento, sto usando curl over ssh.
funziona.
per il resume, come potrei fare?
Code: | curl -u utente -C scp://pippo.it/file.txt
Enter host password for user 'utente':
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
|
ah, io per scaricare faccio così, vi sembra normale?
Code: | curl -u utente scp://pippo.it/file.txt >file.txt |
l'rsync non mi funziona, purtroppo _________________ Darkman |
|
Back to top |
|
|
Kernel78 Moderator
Joined: 24 Jun 2005 Posts: 3654
|
Posted: Sat Aug 28, 2010 1:21 pm Post subject: Re: curl e scp |
|
|
darkmanPPT wrote: |
l'rsync non mi funziona, purtroppo |
rsync funziona tranquillamente su ssh quindi non capisco perchè vorresti farlo passare da curl (sempre che sia questo che tu voglia fare) ... _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
|
darkmanPPT Veteran
Joined: 13 Apr 2006 Posts: 1069 Location: vi/bo
|
Posted: Sat Aug 28, 2010 10:52 pm Post subject: |
|
|
mah, ti dico....
io l'ho provato l'rsync e i risultati dei vari test sono i seguenti:
- Nel primo caso non avevo i permessi di scrittura sulla directory ove risiedeva il file. Rsync mi ha dato come errore questo adducendo che doveva scriversi un file.
- Nel secondo/terzo/quarto/etc.. tentativo, ho copiato il file in questione in una directory del server ove avevo i permessi di scrittura e non mi ha dato errore. (putroppo l'output non ce l'ho più sotto mano). praticamente, dopo un po', mi diceva di aver completato il tutto.
il risultato però era che il file semi-scaricato sul mio pc non veniva toccato.
alla fine ho risolto splittando il file residente sul server in vari token.
ecco il comando di rsync che davo
Code: | rsync --partial --rsh=ssh --progress file.rar pippo@pluto.it:"~/file.rar" |
_________________ Darkman |
|
Back to top |
|
|
Kernel78 Moderator
Joined: 24 Jun 2005 Posts: 3654
|
Posted: Mon Aug 30, 2010 12:49 pm Post subject: |
|
|
mai avuto problemi con rsync spostando anche file fino a 8 gb ...
ho sempre avuto accesso in rw sia sulla macchina di partenza che su quella di arrivo quindi non sono mai incappato in problemi di permessi ...
Giusto per specificare: io non ho mai usato le virgolette per il percorso ... _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
|
darkmanPPT Veteran
Joined: 13 Apr 2006 Posts: 1069 Location: vi/bo
|
Posted: Mon Aug 30, 2010 7:36 pm Post subject: |
|
|
ciao, grazie della risposta.
mah!
non ho dubbi che tu non abbia avuto alcun problema.
ma che dipenda, forse, dalla versione del demone ssh sul server?
devo dire che è strano assai. tra i computer di casa, confermo che funziona. peccato che il computer server sul quale ho eseguito tale operazione non è accessibile fisicamente da me.
beh, la prossima volta che mi capiterà, posterò gli errori.
comunque, grazie
ps: sia con le virgolette che senza, il problema non è cambiato. _________________ Darkman |
|
Back to top |
|
|
|