I want to run screen
on a remote host on which I do not have root/sudo privilege and screen
is not installed.
我想运行screen
上,我没有根/ sudo的特权和远程主机上的screen
尚未安装。
I can compile or copy the screen
program that can run on the host. However, it reports:
我可以编译或复制可以在主机上运行的screen
程序。 但是,它报告:
“Cannot make directory ‘/var/run/screen’: Permission denied”
“无法使目录'/ var / run / screen':权限被拒绝”
As screen is not installed on the host, the directory var/run/screen/
does not exist.
由于主机上未安装screen,因此目录var/run/screen/
不存在。
How to run screen on a Linux host without requiring root privilege?
如何在不需要root特权的情况下在Linux主机上运行屏幕?
The directory /var/run/screen/
is the socket directory for screen
.
该目录/var/run/screen/
是插座的目录screen
。
Fortunately, screen
reads a environment variable SCREENDIR
to get an alternative socket directory.
幸运的是, screen
读取了环境变量SCREENDIR
以获取备用套接字目录。
So to work around it, you can create a directory, such as ~/.screen
:
因此,要解决此问题,您可以创建一个目录,例如~/.screen
:
mkdir ~/.screen && chmod 700 ~/.screen
and export the SCREENDIR
to point to that directory:
并导出SCREENDIR
以指向该目录:
export SCREENDIR=$HOME/.screen
You can also put this line into you ~/.bashrc
so that it will also take effect afterwards.
您也可以将此行放入~/.bashrc
,以使其随后生效。