From 81eb24faea59fd5c87e12a8673439944ae78e7e0 Mon Sep 17 00:00:00 2001 From: hellt Date: Tue, 26 Jan 2021 21:32:41 +0200 Subject: [PATCH] add default root user for srl --- clab/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clab/config.go b/clab/config.go index 7ce2e2490..a10d058ed 100644 --- a/clab/config.go +++ b/clab/config.go @@ -449,11 +449,15 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error { } // initialize specifc container information - node.Cmd = "sudo bash -c /opt/srlinux/bin/sr_linux" + node.Cmd = "sudo sr_linux" kindEnv := map[string]string{"SRLINUX": "1"} node.Env = mergeStringMaps(kindEnv, envs) + // if user was not initialized to a value, use root + if user == "" { + user = "0:0" + } node.User = user node.Sysctls = make(map[string]string)