By default, the package manager apk is not installed, so install it.
$ wget -qO- http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86/apk-tools-static-2.10.5-r1.apk | tar -xz sbin/apk.static && ./sbin/apk.static add apk-tools && rm sbin/apk.static && rmdir sbin 2> /dev/null
$ apk update
$ apk upgrade
$ apk add zsh vim git openssh
$ vim /etc/passwd
#Change before
root:x:0:0:root:/root:/bin/ash
#After change
root:x:0:0:root:/root:/bin/zsh
Restart iSH after making changes.
Then the prompt is displayed as \ h: \ w \ $
and it is hard to see, so let's change the prompt.
I want to make it common to all users, so create / etc / zshrc.
setopt PROMPT_SUBST # allow funky stuff in prompt
if [ "$USER" = "root" ]; then
color="red" # root is red, user is cyan
else
color="cyan"
fi;
local ok_yuno="%F{yellow}✘╹◡╹✘%f"
local bad_yuno="%F{red}✘>﹏<✘%f"
local command_line="
%F{green}%B%*%b%f %F{$color}%B%n@%m%b%f %F{green}%B%~%b%f
%(?.${ok_yuno}.${bad_yuno}) %F{yellow}%B%#%b%f "
export PROMPT="${command_line}"
Also / etc / vimrc
syntax enable
set number
set title
set cursorline
set virtualedit=onemore
set showmatch
set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set hlsearch
nmap <Esc><Esc> :nohlsearch<CR><Esc>
set fenc=utf-8
set encoding=utf-8
scriptencoding utf-8
set ambiwidth=double
inoremap { {}<Left>
inoremap {<Enter> {}<Left><CR><ESC><S-o>
inoremap ( ()<ESC>i
inoremap (<Enter> ()<Left><CR><ESC><S-o>
inoremap [ []<Left>
inoremap ' ''<Left>
inoremap " ""<Left>
nnoremap j gj
nnoremap k gk
nnoremap <down> gj
nnoremap <up> gk
It's a magical magic.
$ cat /dev/location > /dev/null &
Next, always allow the use of iSH location information in the iPad OS settings app.
The iSH terminal is a bit dull, so it would be great if you could operate it from a client you're used to.
Here, I will try to operate iSH using the Blink Shell
recommended by Minori.
Port 22000 #Cannot be accessed from the same device at number 22
PermitRootLogin yes #Change to No later
PubkeyAuthentication yes
PasswordAutentication yes #Change to No later
ClientAliveInterval 60 #As you like so that the SSH is uninterrupted
ClientAliveCountMax 60
$ passwd #Decide on a root password
$ ssh-keygen -A
$ /usr/sbin/sshd
All you have to do is connect from your favorite client (o ・ ω ・ o)
ssh root@localhost -p 22000
$ adduser -s /bin/zsh minorin
$ addgroup minorin wheel
Install sudo
$ apk add sudo
$ visudo
#Uncomment
%wheel ALL=(ALL) ALL
$ su minorin
$ chmod 755 /home/minorin
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ cd .ssh
$ touch authorized_keys
$ chmod 600 authorized_keys
$ ssh-keygen
$ chmod 600 id_rsa
Then copy and paste the client's public key into autorized_keys
.
PermitRootLogin no
PasswordAutentication no
AddressFamily inet
UseDNS no
$ sudo /usr/sbin/sshd
All you have to do now is make sure you can SSH from your usual client with key authentication.
ssh minorin@localhost -p 22000
$ apk add openrc
$ rc-update add sshd
This should start sshd automatically, but it doesn't work (; ∀ ;)
$ apk add alpine-sdk libstdc++ libc6-compat npm libx11-dev libxkbfile-dev libsecret-dev python3
$ npm config set unsafe-perm true
$ npm config set python python3
$ npm install -g @google-cloud/[email protected]
$ npm install -g code-server
npm WARN @coder/[email protected] requires a peer of @google-cloud/logging@^4.5.2 but none is installed. You must install peer dependencies yourself.
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/code-server/node_modules/tar-fs/node_modules/chownr
npm ERR! dest /usr/lib/node_modules/code-server/node_modules/tar-fs/node_modules/.chownr.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/lib/node_modules/code-server/node_modules/tar-fs/node_modules/chownr' -> '/usr/lib/node_modules/code-server/node_modules/tar-fs/node_modules/.chownr.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-**-*****_**_**_****-debug.log
It was no good (; ∀ ;)
I'm going to try VNC settings for the time being.
Recommended Posts