打开CentOS7的终端显示:couldn't get a file descriptor referring to the console。中文意思是:无法获取指向控制台的文件描述符

1.sudo init 3从GUI模式切换到CLI模式。

  (图形用户接口,Graphical User Interface)

  (命令行接口,Command Line Interface)

2.使用root用户登录:输入root用户的用户名(就是root)和root用户的密码。

 

 

 

3.执行以下命令:

 

usermod -a -G tty username

 

username表示用户名。这个命令是将username这个用户添加到tty组中,这样username用户便可以访问控制台了。

 

注意:第一步很重要,如果在GUI界面的终端中使用root用户登录然后执行第三步,如果退出终端再打开终端之后问题还是没有解决,

所以一定要在CLI模式下使用root用户登录,然后增加非root用户访问console(控制台)的权限。

posted @ 2023-05-15 02:27  Guanjie255  阅读(558)  评论(0)    收藏  举报