DEV Community

How to install SSH Server in Termux

Here's a summary of the tutorial in 10 sentences: To install SSH in Termux, start by updating your packages using the command pkg update && pkg upgrade -y. Next, install the SSH package with the command pkg install openssh -y. You'll need to edit the SSH configuration file, which can be done using the nano editor. If you don't have nano, install it with pkg install nano -y. Open the configuration file with nano $PREFIX/etc/ssh/sshd_config and unblock Port 22, changing it to a 4-digit port number, such as Port 2222. Save and exit the file using ctrl + x, y, enter. To activate the SSH server, type sshd in Termux. You can test the SSH connection from another device using the command ssh -p @, replacing with your port number, username, and IP address. To find your username, use the whoami command, and to find your IP address, use the ifconfig command. With these steps, you can successfully set up an SSH server in Termux.
favicon
dev.to
dev.to
Create attached notes ...