That error you posted can actually be ignored. Generally stackexchange has high quality answers.
http://unix.stackexchange.com/questions/171519/lsof-warning-cant-stat-fuse-gvfsd-fuse-file-system As for the "right" way, both of the options you listed will work pretty much as expected. sudo -i allows customization in the /etc/sudoers file, while the "su -" variant simply loads the system environment. Out of the box they should be the same. On multi-user systems I actually prevent "sudo su -" from working, and define lists of applications that certain users/groups can use sudo for. Both sudo -i and su are extremely dangerous. Generally I avoid running a shell as root, so I tend to just use sudo <command>, and sudoedit <restricted file>. This has the advantage of an audit trail, so if I screw up I can usually figure out how and where. On Tue, Mar 17, 2015 at 11:53 AM, Gustin Johnson <gus...@meganerd.ca> wrote: > Why not just use sudo to run lsof? > > sudo lsof |grep openvpn > > If you are looking for listening ports, then: > sudo lsof -i |grep openvpn > > > > On Tue, Mar 17, 2015 at 11:39 AM, Joe S <joes...@shaw.ca> wrote: > >> I am wondering if someone can tell me the right way to get a root shell >> through sudo. I tried the following commands: >> sudo su - >> sudo -i >> >> Then tried the following command and got this warning: >> >> lsof|grep openvpn >> lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file >> system /home/joe/.gvfs Output information may be incomplete. >> >> It looks like Linux is looking in the wrong directory for info. I have >> read that the correct way to do this was sudo su - >> This would use root's environment and home directory. >> >> Looking on the Net is confusing as I get conflicting advice between >> this. >> >> Thanks >> >> _______________________________________________ >> clug-talk mailing list >> clug-talk@clug.ca >> http://clug.ca/mailman/listinfo/clug-talk_clug.ca >> Mailing List Guidelines (http://clug.ca/ml_guidelines.php) >> **Please remove these lines when replying >> > >
_______________________________________________ clug-talk mailing list clug-talk@clug.ca http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying