Snap login without password prompt?

For an automatic deployment script on a machine, I would like to login to snap (not snapcraft) and pull my private snap.

echo -e “password” | snap login

does not work and bring error : inappropriate ioctl for the device

Is there anyway to make snap login read from stdin the password ?


PS : I’m actually trying to interactively ask the password at the beginning of the script, then providing to snap login later in the script.

1 Like

Check out snapcraft export-login --help.

But is there an option to use this feature without installing snapcraft ?

Since I’m deploying on external machine, i just need to pull my (private) snap

It seems like overkill to deploy snapcraft on user machines that just need to run the snap package we have built.

Any advise ?

I’m not sure I understand what you’re trying to do.

If this is for deploying on a machine, why wouldn’t you use the seeding mechanism?

Our snap is private , so I need to login to my account.

The export-login mechanism is very fine, but does not seem to work to install/pull a private snap, and needs to install snapcraft, so it’s not suitable in our case.

Are we doing something too much weird or wrong ?

edit : Let me get some documentation with this seeding mechanism and coming back, I apparently skipped that part.

hmm I did not find any documentation, what is the seeding mechanism ?

My use case is :

Deploy a new machine
install our private snap
Give the the machine to the user

edit : By seeding algorithm are you referring to the gadget snap features ?