Reputation: 14296
I am using CLion in my Windows PC to run and debug code on a Raspberry Pi, using the Remote development option with GDB.
How can I make that remote code on my Raspberry Pi run as root when I debug it?
Upvotes: 0
Views: 1672
Reputation: 31
there is a way, but not recommended, you can log as root in clion.
vim /etc/ssh/sshd_config
PermitRootLogin yes
systemctl restart sshd
sudo passwd root
Remote Host
to login as root (Files->setting->Build, Execution, Deployment->Toolchains->Credentials). Procedure described here.This worked for me.
Upvotes: 0
Reputation: 11
I assume you are using Full Remote Mode
i.e. you created new toolchain with Remote Host
option as described here.
There is no way to run GDB with sudo
. But you can make CLion ssh into your raspberry with root account. Just change settings in Credentials
section. (Also make sure you have SSH root login enabled.)
If you ever need more control over GDB, go with gdbserver.
Upvotes: 1