Termux Notes

1 SSH 

1.1 Setup SSH (SCRIPT)

 
#!/bin/bash # Upgrade Termux packages pkg upgrade -y # Install OpenSSH pkg install openssh -y # Install termux-api pkg install termux-api -y # Set password for SSH automatically echo -e "123456\n123456" | passwd # Retrieve and display the username USERNAME=$(whoami) echo "Your username is: $USERNAME" # Retrieve and display the IP address IPADDR=$(termux-wifi-connectioninfo | awk -F'"ip":' '{print $2}' | awk -F'"' '{print $2}' | tr -d '[:space:]') echo "Your IP address is: $IPADDR" # Start the SSH server sshd echo "OpenSSH has been installed and the server has been started." echo "You can connect using the following:" echo "Username: $USERNAME" echo "IP Address: $IPADDR" # Provide the SSH command for the user echo "To connect via SSH, use the following command:" echo "ssh $USERNAME@$IPADDR -p 8022"

1.2 Connect to Termux by CMD

 
#Delete Saved IP ssh-keygen -f "C:\Users\xxxREPLACE_USER_PROFILE_NAMExxx\.ssh\known_hosts" -R "[192.168.2.128]:8022" #Connect SSH IP ssh u0_a255@192.168.2.128 -p8022

#Delete All Saved IP ssh-keygen -f
del "C:\Users\xxxREPLACE_USER_PROFILE_NAMExxx\.ssh\known_hosts"

2. Change repository

 
#is used to change the Termux package repository. termux-change-repo

3. Keep Termux running when the screen is off

 
#To keep Termux running when the screen is off, you can use the `termux-wake-lock` command. This command will hold a partial wake lock, preventing the device from sleeping. termux-wake-lock #To release the wake lock, you can use: termux-wake-unlock

4. Alist

 
#Update pkg update -y && pkg upgrade -y pkg install wget unzip -y #Install Alist pkg install alist #Admin Alist alist admin #Server Alist alist server


5. The command sets the default ACLs for the "uploads" directory to grant read, write, and execute permissions to the owner (user), group, and others.(uploads is the path of folder)(File Manager for TAMP)(Fix Permission Issues)

 
setfacl -d -m u::rwx,g::rwx,o::rwx uploads

Comments

Popular posts from this blog