LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-19-2016, 09:31 AM   #1
pdi
Member
 
Registered: May 2008
Posts: 50

Rep: Reputation: 59
OpenSSH Privilege Separation


The openssh privilege separation (privsep) works by chrooting a forked and unprivileged sshd process; a process owned by a user with a restricted home directory, and no login shell. The recommendation by the author of privsep [1], and by openssh [2], is to use /var/empty, with permissions 0755, owned by root:root (or similar group). The openssh package in Slackware is indeed compiled with the --with-privsep-path=/var/empty option, and the directory /var/empty exists with correct ownership and permissions. However, examining the user sshd in /etc/passwd, the home directory is set to system root (/), not to /var/empty. Considering that UsePrivilegeSeparation sandbox is now a default setting, and provided that setting chroot to / it is not an oversight, what might be the reasoning behind it?

[1] http://citi.umich.edu/u/provos/ssh/privsep-faq.html
[2] /usr/doc/openssh-7.1p2/README.privsep
 
Old 02-19-2016, 09:53 AM   #2
tdos20
Member
 
Registered: Aug 2006
Location: London
Distribution: Slackware
Posts: 132

Rep: Reputation: 39
I think this might be that once you have chrooted then / is the same as /var/empty, if you set it to /var/empty then you would end up with /var/empty/var/empty, I seem to remember having similar confusion setting up chrooted sftp access once.
 
Old 02-19-2016, 10:00 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,102

Rep: Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178Reputation: 4178
I don't know the reasoning behind it, but I'm asking myself if that really matters something, as long as the sshd user actually has a /bin/false shell (so he never log in into his $HOME) and the configure option for --with-privsep-path already contains the correct directory.
maybe it's me but I can't see anything contradicting how the thing work as explained in [2], but it could be also it's friday, I'm a little tired and I'm missing something...
 
Old 02-19-2016, 11:14 AM   #4
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,803

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
The home directory of the sshd account is not used. In sshd.c, line 636 or so,
sshd chroot()'s to the hardcoded directory given by --with-privsep-path and then calls chdir("/") regardless of what /etc/passwd contains.
 
3 members found this post helpful.
Old 02-19-2016, 09:48 PM   #5
pdi
Member
 
Registered: May 2008
Posts: 50

Original Poster
Rep: Reputation: 59
Thank you all for your answers, and especially Petri. I'm marking the thread as [SOLVED].
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Privilege Escalation - Getting 'root' privilege Rahil Parikh Linux - Security 2 12-02-2010 01:04 AM
sshd: privilege separation? Half_Elf Linux - Software 15 02-23-2008 12:54 AM
Privilege separation user sshd does not exist Mahonri Linux - Security 13 06-04-2007 11:50 PM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration