I'm mantaining a post-install script for my ubuntu. I'd like to add wifi network connections by bash, so I'd automaticall connect to them later, but I can't figure out a way to do this.
Is there a simple command or config file where I should add my SSIDs and passphrases? Again, without needing to actually connect to a network at the time... Thanks!
EDIT:
As suggested by @LassePoulsen, you can create INI-style files in /etc/NetwokManager/system-connections
. A bit of advice on that:
- Use
uuidgen
to generate the uuid value - Don't forget to
chmod 600
! Explanation:For security, it will ignore files that are readable or writeable by any user or group other than 'root' since private keys and passphrases may be stored in plaintext inside the file.
- You must reload the configuration after manual changes
Useful links: