Hi gang,
Becoming a bit bored with having to elevate myself to root all the time I figured I'd try something else:
Because of my now elevated session I prefer not using /bin/sh but the default root shell /bin/csh instead, however that doesn't work for some reason:
At first I assumed that my effective user id could have something to do with this, but study of csh(1) hasn't shown me anything leading in this direction so far. So I decided to use truss and see if that would show me something:
The 'No such file or directory' isn't really special, I get the same results when I (successfully) execute csh on the host itself.
Also this doesn't seem related to anything external because csh works normally when I don't "abuse" jexec to set my effective userid:
Peculiar behavior which I can't get my fingers behind so far
Thanks in advance for any ideas.
Becoming a bit bored with having to elevate myself to root all the time I figured I'd try something else:
# chmod 4550 /usr/sbin/jexec
. At first this seemed to work exactly as I intended:
Code:
peter@zefiris:/home/peter $ id
uid=1001(peter) gid=1001(peter) groups=1001(peter),0(wheel),964(git),1003(torrent),1006(dvd)
peter@zefiris:/home/peter $ jexec psi sh
# id
uid=1001(peter) gid=1001(peter) euid=0(root) groups=1001(peter),0(wheel),964,1003,1006
Code:
# csh
csh: Permission denied.
Code:
ioctl(16,TIOCGETA,0x7fffffffe180) = 0 (0x0)
stat("/usr/share/nls/C/libc.cat",0x7fffffffdc88) ERR#2 'No such file or directory'
stat("/usr/share/nls/libc/C",0x7fffffffdc88) ERR#2 'No such file or directory'
stat("/usr/local/share/nls/C/libc.cat",0x7fffffffdc88) ERR#2 'No such file or directory'
stat("/usr/local/share/nls/libc/C",0x7fffffffdc88) ERR#2 'No such file or directory'
ioctl(16,TIOCGETA,0x669760) = 0 (0x0)
write(18,"csh: Permission denied.\n",24) = 24 (0x18)
getpid() = 340 (0x154)
exit(0x1)
process exit, rval = 1
Also this doesn't seem related to anything external because csh works normally when I don't "abuse" jexec to set my effective userid:
Code:
peter@zefiris:/home/peter $ ssh 10.0.1.6
Password:
Last login: Fri Aug 10 23:35:50 2018 from psi.intranet.lan
FreeBSD 11.2-RELEASE (Psi) #0 r335886: Sun Jul 8 03:46:16 CEST 2018
Welcome to FreeBSD!
$ csh
%
Thanks in advance for any ideas.