This is the 11th day of my participation in the August More Text Challenge. For details, see:August is more challenging

1. Android operating system

As we all know, the operating system of most smartphones in the market, such as Xiaomi and Huawei, is Android, which is based on the extension of the Unix system

So the phone we use every day is, in theory, a Unix server, and since it’s a server, you don’t need SSH to connect it.

However, mobile phone manufacturers may be out of consideration for user information security, is not not to give the user root permission.

I bought your cell phone, but I can’t possess you completely.

Second, the Termux

Here we need a tool called Termux, which is a mobile APK installation package.

Upload termux’s APK to your phone and install it.

3. Install OpenSSH on your phone

After Termux is installed on the phone, click the icon to enter, which gives us a command line

Enter the following commands in sequence:

1. Apply for read and write permission

termux-setup-storage

The mobile terminal will pop up the permission prompt, select to allow read and write.

2. Install OpenSSH

apt update apt install openssh

3. Start the SSHD service

sshd

At this point, openSSH has been installed on the mobile side

4. SSH connection from PC to mobile phone

1. Scan the phone port

On the PC, use nmap to scan our phone’s address. 【 Mobile phone LAN address, can be viewed in the Settings oh ~~】

I scanned my mobile phone address with nmap, and found that THE SSH service has been enabled, and the port is 8022, indicating that we have successfully installed and started.

2. Reset the password of the current phone user

Check the current user who is logged in to the mobile phone

whoami

It’s a temporary account for U0_A340.

Reset the user’s password to 123456 so we can log into the phone remotely via SSH

3. Log in to the phone using SSH

Open our SSH link tool and log in to the mobile phone command line through port 8022. The login succeeded.

We can now manage the phone over SSH just like we would a server.

But there are many paths that our current account does not have access to.

Go deeper into the folders on your phone to get access to them

Which brings us to a word we hear a lot: one root or something