Ish shell

之前在安卓手机上通过termux部署安装linux shell,家里有一个闲置的iphone,就想能不能在iphone上也运行shell,最后ish shell APP,
大家有兴趣可以尝试一下。

一、安装

在苹果 app store 直接搜索iSH Shell 安装即可。

二、修改镜像源

  1. 修改/etc/apk/repositories文件

    vi /etc/apk/repositories
    

    最上面添加这两行:

    # 阿里云源
    https://mirrors.aliyun.com/alpine/v3.11/main
    https://mirrors.aliyun.com/alpine/v3.11/community
    # 中科大源
    https://mirrors.ustc.edu.cn/alpine/v3.11/main
    https://mirrors.ustc.edu.cn/alpine/v3.11/community
    #这两行,注意v后面的版本号,对应原来文件中的版本号。
    

    保存退出,使用apk update命令更新列表

  2. sed替换

    sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
    

三、配置ssh server

Here’s a quick step by step guide for running an ssh server.

  1. $ apk add openssh — install the ssh tools and the ssh server.
  2. $ ssh-keygen -A — create the host keys.
  3. $ passwd — Set a password for root to protect your iOS device
  4. $ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
  5. $ /usr/sbin/sshd

You should now be able to ssh to your device with username root and the password you typed.

SSH from the same device

If you are trying to connect via ssh from the same device, make sure you set the port configuration of sshd to use a non standard one (greater than 1024, eg: 22000).

You can do this by editing /etc/ssh/sshd_config and set Port 22000 (Replace 22000 with any non-standard port).

After this, you can ssh (from iSH itself) using ssh root@localhost -p 22000

四、在后台运行

在终端执行命令$ cat /dev/location > /dev/null &

github地址: https://github.com/ish-app

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐