Как выйти из tty linux

от admin

Не могу выйти из tty

С первой tty по шестую переключение идёт нормально, на ctrl+alt+F8 реакции нет, а при нажатии ctrl+alt+F7 появляется черный экран, и после этого компьютер больше ни на какие нажатия никаких кнопок не реагирует, и даже на прошлые tty вернуться невозможно, что уж говорить о возвращение в иксы, что мне, собственно, и нужно сделать.

Кстати, на startx консоль выдаёт, что де команда не найдена.

Я немного растерян и совершенно не представляю, что нужно сделать, чтобы это починить. Не подскажете?

How can I leave tty?

So I got a problem here. So I installed SDL 2.0.1, everything worked fine, I installed dependencies of sdl as well, so I saw that it didn’t worked, so I rebooted my pc, after that I get to gnome, and don’t know what do, maybe some help? 🙂

TheScriptan's user avatar

1 Answer 1

Normally, can enter a tty with Ctrl + Alt +( F1 — F12 ), and in Ubuntu, and can exit it with Ctrl + Alt + F7 . This problem is probably due to the login manager not starting. Try:

for the default lightdm login manager, and this for Gnome’s login manager:

Как выйти из tty linux

Under column the Tty pts/0 and pts/5 are the current active terminals.

Apart from those two pts/6 , pts/9 and pts/10 are also present and I had logged into these last week. But the idle time for them is showing as «-» (not idle).

How can I kill these 6,9 and 10 terminals?

10 Answers 10

This would produce an output similar to:

Grab the PID from the result.

Use the PIDs to kill the processes:

For the above example:

If the process doesn’t gracefully terminate, just as a last option you can forcefully kill by sending a SIGKILL

I had the same question as you but I wanted to kill the gnome terminal which I was in. I read the manual on «who» and found that you can list all of the sessions logged into your computer with the ‘-a’ option and then the ‘-l’ option prints the system login processes.

What who gave meYou should get something like this. Then all you have to do is kill the process with the ‘kill’ command.

user avatar

for example kill pts/0

user avatar

I had the same problem today. I had NO remaining processes, but the remaining finger entry of user «xxx», which prevent me the deletion of this user using «userdel xxx».

Error message was: userdel: account `xxx’ is currently in use.

It looked like a crashed terminal session. So I rebooted, but the issue remained.

So I (re)moved the /var/run/utmp file:

This cleared all finger entries. Unfortunately in this way even the current running sessions will be cleared. If this is an issue for you, you have to reboot, after you (re)moved the utmp file.

Читать:
Как узнать длину char c

However in my case this was the solution. Afterwards I was able to successfully delete the user, using «userdel xxx».

how to kill the tty in unix

Under column the Tty pts/0 and pts/5 are the current active terminals.

Apart from those two pts/6 , pts/9 and pts/10 are also present and I had logged into these last week. But the idle time for them is showing as «-» (not idle).

How can I kill these 6,9 and 10 terminals?

10 Answers 10

This would produce an output similar to:

Grab the PID from the result.

Use the PIDs to kill the processes:

For the above example:

If the process doesn’t gracefully terminate, just as a last option you can forcefully kill by sending a SIGKILL

I had the same question as you but I wanted to kill the gnome terminal which I was in. I read the manual on «who» and found that you can list all of the sessions logged into your computer with the ‘-a’ option and then the ‘-l’ option prints the system login processes.

What who gave meYou should get something like this. Then all you have to do is kill the process with the ‘kill’ command.

Jacob Bryan's user avatar

for example kill pts/0

AstroCB's user avatar

The simplest way is with the pkill command. In your case:

Regarding tty sessions, the commands below are always useful:

w — shows active terminal sessions

tty — shows your current terminal session (so you won’t close it by accident)

last | grep logged — shows currently logged users

Sometimes we want to close all sessions of an idle user (ie. when connections are lost abruptly).

pkill -u username — kills all sessions of ‘username’ user.

And sometimes when we want to kill all our own sessions except the current one, so I made a script for it. There are some cosmetics and some interactivity (to avoid accidental running on the script).

Maxwell de Assis's user avatar

I had the same problem today. I had NO remaining processes, but the remaining finger entry of user «xxx», which prevent me the deletion of this user using «userdel xxx».

Error message was: userdel: account `xxx’ is currently in use.

It looked like a crashed terminal session. So I rebooted, but the issue remained.

So I (re)moved the /var/run/utmp file:

This cleared all finger entries. Unfortunately in this way even the current running sessions will be cleared. If this is an issue for you, you have to reboot, after you (re)moved the utmp file.

However in my case this was the solution. Afterwards I was able to successfully delete the user, using «userdel xxx».

Похожие статьи