> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/andoid-shou-ji/termux/untitled.md).

# 啟動 SSH Server‌

## **啟動 SSH Server**

**雖然有以上方法叫出常用的按鍵能，但要方便使用，還是使用PC遠端登入管理最好用，所以，啟用一個ssh server的功能是相當重要的**

**apt可以改用pkg指令**

**$ apt update**\
**$ apt install openssh**

**$ ssh-keygen**

**ssh-keygen**&#x20;

**Generating public/private rsa key pair.**

**Enter file in which to save the key (/data/data/com.termux/files/home/.ssh/id\_rsa):**

**………..**

**cd .ssh**

**$ touch authorized\_keys**\
**$ cat id\_rsa.pub >> authorized\_keys**\
**$ chmod 600 authorized\_keys**\
**$ chmod 700 \~/.ssh**<br>

**啟動 SSH server(預設使用 8022 port)**

**sshd**

**# 偵錯模式**\
**$ sshd -d**\
\
**#停止 sshd**\
**$ pkill sshd** \ <br>

### **把產生的 id\_rsa 複製到遠端PC**

**cd .ssh**

**scp id\_rsa user\@yourPC:/home/user/**<br>

### **使用遠端PC登入termux**

**ssh 手機IP -i id\_rsa -p 8022**<br>

![](/files/-LklLE_qgBKPjPuNvMvu)
