|
|||||||||||
|
RE: PRIVSEP annoys me.
From: Temp <temp(at)eguesswork.co.uk>
Date: Fri Mar 28 2003 - 12:25:43 EST Peter, I've just been integrating some support for RSA's SecurID Token and had some real headaches with Privilege Seperation. The OpenSSH FAQ says Privilege Seperation uses a well defined interface; it's well defined, but very poorly documented! Through a lot of trial and error I finally managed to get everything to work, but it was a real struggle. The only information that I have come across is a link to a document someone gave me http://www.citi.umich.edu/u/provos/ssh/privsep.html Basically you need a pair of processes mm_auth_icc_prepare_key_query & mm_auth_icc_prepare_key_response in monitor_wrap.c and a pair of processes mm_auth_ans_icc_prepare_key_query & mm_auth_ans_icc_prepare_key_response in monitor.c. You will also need add some lines into monitor.h and monitor_wrap.h to "register" your functions in some arrays. The "query" pair of processes send from the unprivileged process to the privileged process and the "response" pair of processes handle any replies coming back the other way. You also have to use built-in functions to push data into a buffer to be sent and extract data from the buffer at the other end. The processes called from monitor_wrap.c run in a restricted shell that does not allow access to the filesystem for calls like stat(). You have to put any function calls that require access to the filesystem in the "shadow" functions in monitor.c that run as "root". Regards,
Chris Macneill
Here is the auth_icc_prepare_key() function in my auth-icc.c. This function gets the pubkey in the ~/.icc/authorized_key file.
int
char line[8192], file[MAXPATHLEN]; u_char n_e[131]; FILE *f; struct stat st; Key *key; }
Everything is ok if in sshd_config: "UsePriviledgeSeperation no".
If I set "UsePriviledgeSeperation" yes, the stat() in the function always
returns <0, but the file does exists.
Why in privsep the sshd cannot access the file?
Please help me.
xhtech. Beijing 享ç¨ä¸ç䏿大ççµåé®ä»¶ç³»ç»â MSN Hotmailã http://www.hotmail.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system ( http://www.grisoft.com). Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003Received on Fri Mar 28 13:14:30 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:56 EDT |
||||||||||
|
|||||||||||