2

在这里将不胜感激。

我正在尝试在 Ubuntu 12.04 机器上设置根监狱,并且我正在使用 Jailkit 2.15。我已经使用http://www.marthijnvandenheuvel.com/2010/03/10/how-to-create-a-chroot-ssh-user-in-ubuntu/指南成功地做到了这一点。

但是,我也想允许用户使用 svn 命令。我已将以下内容添加到 /etc/jailkit/jk_i​​nit.ini

[svn]
comment = the subversion program
executables = /usr/bin/svn
includesections = netbasics

[dshell]
comment = dpicella shell addons
paths = /usr/lib/tcl8.4
libraries = /usr/lib/libexpect5.43.so, /lib64/libgcc_s.so.1
executables = /usr/bin/expect
includesections = netbasics, uidbasics

但是每当我尝试在 root 帐户中使用 SVN 时,我总是会得到:

$ svn co svn+ssh://192.168.1.1/svn/repo/path
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_CTYPE is en_GB.UTF-8
svn: warning: please check that your locale name is correct
password:
svn: No repository found in 'svn+ssh://192.168.1.1/svn/repo/path/'

如您所料,SVN repo 保存在同一台机器上,并且我检查了 svn checkout 命令是否适用于我通常的 bash 用户。我还仔细检查了 subversion 使用的 htpasswd 文件(/etc/subversion/passwd),其中包含用户名:string-pattern。所以这似乎也没问题。

调查语言环境问题,我不确定这里发生了什么或是否是问题,但常识表明第一个错误通常是原因。被监禁帐户中的 locale -a 给了我:

bash: locale: command not found

在普通帐户中,我得到:

C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX

我确实注意到在 jk_init.ini 中:

[basicshell]
comment = bash based shell with several basic utilities
paths = /bin/sh, bash, ls, cat, chmod, mkdir, cp, cpio, date, dd, echo, egrep, false, fgrep, grep, gunzip, gzip, ln, ls, mkdir, mktemp, more, mv, pwd, rm, rmdir, sed, sh, sleep, sync, tar, touch, true, uncompress, zcat, /etc/motd, /etc/issue, /etc/bash.bashrc, /etc/bashrc, /etc/profile, /usr/lib/locale/en_US.utf8
users = root
groups = root
includesections = uidbasics

查看 /usr/lib/locale,我有:

$ ls /usr/lib/locale/
C.UTF-8  locale-archive

这可能是问题,还是我这里有几个问题?

干杯

4

0 回答 0