Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 466 Bytes

executing_commands.md

File metadata and controls

15 lines (8 loc) · 466 Bytes

Executing Commands

Commands executed through LXD will always run as the container's root user.

Getting a shell inside a container named cn1

$ lxc exec cn1 bash

Executing any general command line in cn1 from the Host

**$ lxc exec [<remote>:]cn1 [flags] [--] <command line>

example: change directory to /tmp in cn1 the execute pwd to print the working directory to see that it worked

$ lxc exec cn1 -- sh -c "cd /tmp && pwd"