[plug] chvt as normal user?

Hendrik Strydom hns1 at iinet.net.au
Tue Apr 25 08:27:50 WST 2006


On Tue, 2006-04-25 at 01:45 +0800, Caleb Duggan wrote:
> when i run chvt as root, it works fine but when i run it as a normal user,  
> it says "Couldnt get a file descriptor referring to the console"
> 
> Is there a way to make it work as a normal user? or do i need to use a  
> different command to change to another console as a normal user?
> 
> thanks

It seems you must either run the command from a console (where your user
owns the device associated with the console) or be root.  An xterm is
not a console and therefore the user does not own any device to control.
I suspect the easiest way to do this is to enable sudo without a
password for chvt.  To enable this only for yourself, add:
<username> <hostname> = NOPASSWD: /usr/bin/chvt
to the /etc/sudoers file using visudo, not you usual editor of choice.
<username> and <hostname> must obviously be replaced with your user and
host names.  
Also confirm that chvt is actually in /usr/bin for your distro.

Regards
  Hennie




More information about the plug mailing list