sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.19k stars 221 forks source link

sudo ssh cpu load #187

Closed x0r3n closed 1 year ago

x0r3n commented 2 years ago

Hi. I have a problem with CPU load, with every sudo version (include development) and only on ubuntu 22.04. If I change the user with "sudo" e.g. "sudo su user" and then ssh to another machine, then disconnect the ssh connection properly or just close the console with X (dosen't matter ), the ssh remains stuck on the original machine and loads 100% of the CPU. Only in ubuntu 22.04 and only with sudo. If I become a root first and after it I use "su user" than ssh doesn't stick for example, it works fine with that.

millert commented 2 years ago

I haven't noticed this on my Ubuntu 22.04 system but I will try to reproduce it. Are you running the command in a new pty? In other words, do you have use_pty, log_input or log_output in sudoers? Also, do you see the same behavior when you use "sudo -i -u user" instead of "sudo su user"?

millert commented 2 years ago

You can enable sudo debugging with a line like the following in /etc/sudo.conf.

Debug sudo /var/log/sudo_debug all@debug

Also, strace output when the sshd is spinning could be helpful.

millert commented 1 year ago

Closing this issue as I have been unable to reproduce it. If you still have this problem, try commenting out the following line in sudoers if it is present.

Defaults    use_pty

and see if that changes the behavior.