TTY Settings in Linux

2024. 11. 29. 17:41·Study Record/Cybersecurity
목차
  1. 1. TTY?
  2. 2. Key TTY Settings Commands
  3. 3. Common Issues and Solutions

1. TTY?

In Linux, TTY refers to virtual terminals that emulate the behavior of the original hardware teletypeprinters. TTY settings define how the terminal interacts with user input and system output. 

TTY settings influence:

1) Key behavior (e.g, Ctrl + C, Ctrl + Z, or arrow keys)

2) Terminal size (rows and columns for displaying text)

3) Input/output processing, such as echoing typed characters

4) Special key mappings (e.g., backspace, delete, and interrupt signals)

 

2. Key TTY Settings Commands

1) stty -a: View current TTY Settings (e.g., Baud rate, rows and columns, signal mappings, etc.)

2) stty rows {num} columns {num}: Change terminal size

3) stty sane: Restore default TTY settings

4) stty -echo: Turn off echo (hide typed characters)

 

3. Common Issues and Solutions

1) Arrow keys or backspace not working

   (1) Check and set the correct terminal type:

      - export TERM=xterm-256color

      - export TERM=xterm

   (2) Reset the TTY

      - stty sane

 

2) Improper text alignment

   (1) Adjust the terminal size

 

3) Broken TTY in remote sessions

   (1) Use [script] to spawn a proper TTY

      - script /dev/null -c bash

   (2) Use [Python} to create a TTY

      - python -c 'import pty; pty.spawn("/bin/bash")'

  1. 1. TTY?
  2. 2. Key TTY Settings Commands
  3. 3. Common Issues and Solutions
'Study Record/Cybersecurity' 카테고리의 다른 글
  • [HTB machine] Sense
  • [HTB machine] Nibbles
  • [HTB machine] bashed
  • Penetration Testing Process
Sungyeon Kim
Sungyeon Kim
goldstaryeon@sookmyung.ac.kr
Sungyeon Kim
Sungyeon Kim
Sungyeon Kim
전체
오늘
어제
  • 분류 전체보기 (619) N
    • Paper Review (30)
    • Research Record (9)
    • Study Record (143)
      • Cybersecurity (79)
      • AI Data Science (28)
      • Computer Science (24)
      • Linear Algebra (6)
      • SQL (5)
      • LaTeX (1)
    • English Transcription (260)
    • 한글 필사 (100) N
    • 날것 그대로의 생각들 (73) N

인기 글

최근 댓글

최근 글

hELLO· Designed By정상우.v4.5.3
Sungyeon Kim
TTY Settings in Linux
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.