【将你的安卓手机变成linux服务器之配置termux】

配置termux软件

1、下载termux

可以在termux官网或者其他比较安全的网站下载app

2、切换pkg软件源

输入命令,可以进入切换软件源界面

termux-change-repo

选择USTC软件源

3、安装open-ssh

a、输入命令

pkg install openssh

报错处理

CANNOT LINK EXECUTABLE "ssh-keygen": library "libcrypto.so.3" not found: needed by main executable
CANNOT LINK EXECUTABLE "ssh-keygen": library "libcrypto.so.3" not found: needed by main executable
CANNOT LINK EXECUTABLE "ssh-keygen": library "libcrypto.so.3" not found: needed by main executable
CANNOT LINK EXECUTABLE "ssh-keygen": library "libcrypto.so.3" not found: needed by main executable

需要更新ssl

pkg install openssl

然后安装openssh成功
b、添加秘钥

ssh-keygen -A

c、启动ssh

sshd

d、查看用户名

whoami

e、查看ip

ifconfig

f、设置密码,否则ssh访问被拒

passwd

4、远程登录ssh

使用ssh协议登录

ssh -p8022 [email protected]

登录报错

C:\Users\jiangcheng>ssh -p8022 [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:9eRAhza7fTCjqc4VD/iswDbCrMS0lomlICnwwY/Pxwk.
Please contact your system administrator.
Add correct host key in C:\\Users\\jiangcheng/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\jiangcheng/.ssh/known_hosts:15
Host key for [172.20.52.246]:8022 has changed and you have requested strict checking.
Host key verification failed.

清理用户文件夹下.ssh/known_hosts,继续登录

C:\Users\jiangcheng>ssh -p8022 [email protected]
The authenticity of host '[172.20.52.246]:8022 ([172.20.52.246]:8022)' can't be established.
ED25519 key fingerprint is SHA256:9eRAhza7fTCjqc4VD/iswDbCrMS0lomlICnwwY/Pxwk.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[172.20.52.246]:8022' (ED25519) to the list of known hosts.
[email protected]'s password:

Welcome to Termux!

Community forum: https://termux.com/community
Gitter chat:     https://gitter.im/termux/termux
IRC channel:     #termux on libera.chat

Working with packages:

 * Search packages:   pkg search 
 * Install a package: pkg install 
 * Upgrade packages:  pkg upgrade

Subscribing to additional repositories:

 * Root:     pkg install root-repo
 * X11:      pkg install x11-repo

Report issues at https://termux.com/issues

你可能感兴趣的:(termux,linux,服务器,android,termux,ssh)