The UNIX and Linux Forums  
Hej och välkommen från USA till UNIX och Linux Forum! Tack för ditt besök och gå med i vår globala gemenskapen.

Go Back   UNIX och Linux Forum > Upp Forum > Shell-programmering och Skript
.
google unix.com



Shell-programmering och Skript Post frågor om ksh, CSH, SH, bash, PERL, PHP, sed, awk och andra skalskript och skal skriptspråk här.

Mer UNIX och Linux Forum Ämnen Du kan hitta Helpful
Tråd Thread Starter Forum Svar Senaste Inlägg
Användarinloggning problem & Filer notering problem. pernasivam AIX 1 06-18-2009 10:09
Loop problem med ett större problem aliahsan81 Shell-programmering och Skript 3 01-07-2009 02:02
problem med att finna ett maskinvaruproblem girish.batra Sun Solaris 8 09-09-2008 11:10
ssh script problem problem pcjandyala Shell-programmering och Skript 2 07-31-2008 04:27
Problemet med dd-kommando eller kanske AFS problem Anta Shell-programmering och Skript 0 08-25-2006 11:10

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Sök i denna tråd Rate Thread Visningslägen
  #1 (permalänk)  
Old 07-01-2009
anushree.a anushree.a is offline
Registered User
  
 

Join Date: maj 2008
Inlägg: 87
GPG Encription problem

Kära vänner,
Jag har använt symmetriska gpg kryptering. Jag kryptera en fil på följande sätt

gpg - symmetrisk <filnamn>

Därefter uppmanas att ange lösenord två gånger

Nu problme är, jag har några 700 konstiga filer som ska krypteras med symmetrisk gpg encription
Kanna fullständig plz berätta hur man gör det genom att använda "för"Loop.

Tack på förhand
Anushree.a
  #2 (permalänk)  
Old 07-01-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Ort: Florida
Inlägg: 1.927
man gpg. Läs upp om partiet läge.
  #3 (permalänk)  
Old 07-07-2009
anushree.a anushree.a is offline
Registered User
  
 

Join Date: maj 2008
Inlägg: 87
gått thro mannen gpg resultat ... men inte kan få nödvändig information ...
Snälla om någon vet lösningen vänligen meddela mig
Tack på förhand
Anushree
  #4 (permalänk)  
Old 07-07-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Ort:. Tillhör
Inlägg: 1.872
Från mannen sida (som du har naturligtvis läst) några alternativ som kan vara till hjälp:
Kod:
       --batch
       --no-batch
              Use batch mode.  Never ask, do not allow  interactive  commands.
              --no-batch disables this option.

       --no-tty
              Make  sure that the TTY (terminal) is never used for any output.
              This option is needed in  some  cases  because  GnuPG  sometimes
              prints warnings to the TTY even if --batch is used.

       --passphrase-fd n
              Read the passphrase from file descriptor n. Only the first  line
              will  be  read  from  file descriptor n. If you use 0 for n, the
              passphrase will be read from stdin. This can  only  be  used  if
              only  one  passphrase is supplied.  Note that this passphrase is
              only used if the option --batch has also been  given.   This  is
              different from gpg.


       --passphrase-file file
              Read  the passphrase from file file. Only the first line will be
              read from  file  file.  This  can  only  be  used  if  only  one
              passphrase is supplied. Obviously, a passphrase stored in a file
              is of questionable security if other users can read  this  file.
              Don't  use  this  option  if  you  can avoid it.  Note that this
              passphrase is only used if the  option  --batch  has  also  been
              given.  This is different from gpg.


       --passphrase string
              Use  string as the passphrase. This can only be used if only one
              passphrase is supplied. Obviously, this is of very  questionable
              security  on  a  multi-user system. Don't use this option if you
              can avoid it.  Note that this passphrase is  only  used  if  the
              option --batch has also been given.  This is different from gpg.
  #5 (permalänk)  
Old 07-10-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Ort:. Tillhör
Inlägg: 1.872
Eftersom du startade en andra tråden för samma fråga (tydligen) utan att läsa man-sidan kommer jag att ge en lösning den här gången.

Kod:
> cat pass
s3cr3t
> gpg --batch --no-tty --armor --passphrase-file pass --symmetric test.file
> ls test.*
test.file  test.file.asc
> file test.file.asc
test.file.asc: PGP armored data message
  #6 (permalänk)  
Old 07-13-2009
anushree.a anushree.a is offline
Registered User
  
 

Join Date: maj 2008
Inlägg: 87
Jag vet inte hur du använder din lösning.

Sedan är det o / pi fick när jag kör scriptet

test.sh: 1:. / pass: Permission denied
test.sh: 2: s3cr3t: kommando hittades inte
test.sh: 3: - parti: kommando hittades inte
test.sh: linje 4:. / test.file: Permission denied
test.sh: linje 5:. / test.file: Permission denied
test.sh: line 6: test.file.asc: kommando hittades inte
test.sh: linje 7: test.file.asc: kommando hittades inte
  #7 (permalänk)  
Old 07-13-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Ort:. Tillhör
Inlägg: 1.872
Det är förmodligen därför som jag inte är en komplett manus, utan snarare ett exempel på hur det skulle se ut då göras manuellt. Utstationering igen med kommentarer för att förtydliga:
Kod:
> cat pass    # Run the 'cat' program to show the contents of file 'pass' which
              # contains the passphrase
s3cr3t        # Contents of file 'pass'
# Calling gpg in batch mode, telling it not to allocate a TTY, asking for
# ASCII-Armor output (non-binary data), providing the passphrase in file 'pass',
# symmetric enryption for file 'test.file'
> gpg --batch --no-tty --armor --passphrase-file pass --symmetric test.file
> ls test.*   # Display a listing of the original & encypted file
test.file  test.file.asc
> file test.file.asc # Run the 'file' utility to take a guess at the type of the
                     # content of file 'test.file.asc'
test.file.asc: PGP armored data message # It tells us that it's encrypted,
                                        # armored data
Allt du behöver göra är att ersätta filnamn jag med dem som du har. Så snart du har fått ner, börja använda variabler i stället för filnamn. Och när det är gjort kan du börja med att slinga.
Reply

Komihåglista

Taggar
kryptering, gpg

Thread Tools Sök i denna tråd
Sök i denna tråd:

Avancerad sökning
Visningslägen Betygsätt denna tråd
Betygsätt denna tråd:

Utstationering Regler
Du får inte efter nya trådar
Du får inte efter svar
Du får inte skicka bilagor
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG] kod
HTML-koden är Av
Trackback är
Pingbacks är
Refbacks är




Alla tider är GMT -4. Klockan är nu 06:17.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Översättningar Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX och Linux Forum Innehållet upphovsrättsskyddat © 1993-2009. All Rights Reserved.Ad förvaltning RedTyger

Content Relevant webbadresser från vBSEO 3.2.0