大网数据广告活动
服务器运维问答

How to encode Pre-Shared Key (PSK) of and L2TP IPSEC connection managed by Network-Manager

· 52CE 我爱测

If I create a VPN L2TP IPSEC connection using Network-Manager GUI, I introduce the PSK, but this one looks different on /etc/NetworkManager/system-connection/myvpn.nmconnection I am thinking the PSK gets encoded somehow, since it…

问题原文

原帖链接 · Javi Hache · CC BY-SA 4.0

If I create a VPN L2TP IPSEC connection using Network-Manager GUI, I introduce the PSK, but this one looks different on /etc/NetworkManager/system-connection/myvpn.nmconnection

I am thinking the PSK gets encoded somehow, since it begins with 0s it's probably binary base64 encoded (I read this in NetworkManager's docs). I have no clue how to encode this.

I am also guessing, if I want to create a connection with nmcli connection add from terminal (I use Ubuntu Server 20.04), I will need to encode the PSK so it will be properly read in the config file. How should I go about this? Can I just type the PSK in plain text into the command or change the Key/Value pair inside the .nmconnection file without using GUI so it will be read and interpreted the right way?

Thanks!

已采纳解答

原帖链接 · Douglas Kosovic · CC BY-SA 4.0

libreswan and strongswan accept PSKs that are plain text or base64 starting with 0s. Similarily you can use either format in the vpn connection configuration file you want to edit.

If you edit the connection configuration file (e.g. to change to plain text PSK), be sure to issue the following so that any connection changes are picked up:

nmcli con reload

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-02-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。