Bug 42647 - command line option to specify password
Summary: command line option to specify password
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Commandline
  Show dependency treegraph
 
Reported: 2011-11-06 11:37 UTC by Battery Staple
Modified: 2025-10-17 14:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Battery Staple 2011-11-06 11:37:45 UTC
Hi,

it would be very nice if one could open libreoffice with

soffice --password="passwordstring" [file]

and

soffice --passfile="/location/to/password/in/file" [file]

I'd like to store encrypted libreoffice files on dropbox, but I really do not want to type in my [random] password every time.

Thanks a lot!
Comment 1 sasha.libreoffice 2012-04-19 04:42:35 UTC
Thanks for new idea
Writing password as plain text that anyone can see it.
Comment 2 Battery Staple 2012-04-19 07:35:05 UTC
I've described a scenario where it makes sense to supply the password in plaintext. Plus I've asked for keyfile support, so what's your problem with that?
Comment 3 sasha.libreoffice 2012-04-19 22:17:00 UTC
Thanks for additional information.
Integration with system and desktop password handling will be also interesting
Comment 4 Mani 2015-08-03 05:21:41 UTC Comment hidden (obsolete)
Comment 5 Thibaut Barrère 2016-04-28 09:15:14 UTC
I tried to use soffice to automate conversion of XLSX encrypted files in a production environment, and ended up finding this ticket.

If we were to follow twelve-factor config recommendations (http://12factor.net/config), which is often used today in PaaS, then we could have passwords set in environment, then call:

soffice --password="$PASSWORD"

Which is not stored in history etc.

I would definitely have a use for that (plenty of "ETL" types of work requires conversion of all kinds, and soffice is a great way to do that even on production servers).
Comment 6 gmolleda 2022-06-05 08:42:22 UTC
I want to convert many excel files to calc where they all have the same password (they are exam deliveries) and it would be better if I could also save them without a password.

In Esperanto, the language that does not discriminate by nationality:
Mi volas konverti multajn Excel-dosierojn al Calc kie ili ĉiuj havas la saman pasvorton (ili estas enretigaj ekzamenoj) kaj estus pli bone, se mi ankaŭ povus konservi ilin sen pasvorto.
Comment 7 william.tambellini 2022-11-29 19:45:20 UTC
+1
Comment 8 R. Diez 2025-10-17 14:57:06 UTC
For inspiration, openssl has command-line options -passin and -passout, which accept a password in a variety of ways:

https://docs.openssl.org/master/man1/openssl-passphrase-options/

The most secure way is probably the "fd:number" syntax to pass a file descriptor. This way, the caller can use a pipe or a FIFO, which are not so easy to snoop.

sshpass has a similar option, see its command-line option "-dnumber" here:
https://linux.die.net/man/1/sshpass