FTPD, CHROOT, SMF and non-root user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers FTPD, CHROOT, SMF and non-root user
# 1  
Old 01-12-2006
FTPD, CHROOT, SMF and non-root user

Hello
I am trying to configure WU-FTPD on Solaris 10 to do the following:

Using the -r parameter to in.ftpd, I am running the FTP demon within a CHROOT jail (/export/ftp). The FTP service is also being controlled by SMF. This seems to work fine.

However, one of the requirements I have is to run the FTP demon as a non-root user (in case someone hacks the demon, gets root and breaks out of the chroot jail). I configured our FTP SMF manifest file by changing the following lines:

<method_context>
<method_credential user='root' group='root' />
</method_context>

to be the following

<method_context>
<method_credential user='ftpdmon' group='ftpdmon' />
</method_context>

where ftpdmon is the user that will be running the FTP demon.

The problem I am having is that when the FTP demon is started by SMF, the following error is seen:

'Cannot chroot to initial directory, aborting'

A truss output gives the following

20534: chroot("/export/ftp") Err#1 EPERM [proc_chroot]

Is what I am trying to do impossible - i.e. allow a non-root user to run the FTP demon within a CHROOT jail? Does the -r argument to in.ftpd only apply if you are a root user? Is this something to do with SMF?

Thanks in advance for any help that people can give,

Thanks
Kind regards
Dave
# 2  
Old 01-12-2006
I checked the Solaris 10 chroot man page. And it says quite clearly that only superuser can use chroot. So it would appear that you will have to run the ftp daemon as root if you want to chroot.
# 3  
Old 01-12-2006
What you are attempting is impossible even without the use of chroot. When you connect to a ftp server, the server will ask for a user name and password. The ftp server looks up the uid of the user in question. It then changes the uid of the ftpd process to the uid of the user. Then it allows the user to enter his first command. Only a root process can change its own uid. If you simply assign your ftp users a non-zero id, they will not be running as root.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to get user environment variable for smf daemon?

I am new to smf...I am trying to create new smf service and starting a Python daemon script. The python daemon script will call few other scripts internally as subprocess. The scripts which are called by daemon are unknown of user environment variables. How can I execute smf service in user... (1 Reply)
Discussion started by: Sivaramakrishna
1 Replies

2. Linux

Configuring wu-ftpd for ftp user login

I am having trouble configuring wu-ftpd on my system to allow a real user to login. I am not sure where to start. I'll try to give as much information as possible. Here is a log of what happened. ftp> open 192.168.4.110 Connected to 192.168.4.110 220 192.168.4.110 FTP server (Version... (0 Replies)
Discussion started by: mnmonu
0 Replies

3. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

4. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

5. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

6. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

7. UNIX for Dummies Questions & Answers

etc/ftpd/ftpusers & philosophy of disabling root

we don't have root in our /etc/ftpd/ftpusers and we are getting some pushback from the external auditors about this - specifically as a security risk if a "sniffer" were to catch roots password at the ftp. What do most shops do - disable ftp for root? What do you do to get things to the... (3 Replies)
Discussion started by: LisaS
3 Replies

8. UNIX Desktop Questions & Answers

how to check if a file ftpd to mainframe was actually ftpd

Hi All, I am ftping a file from unix to mainframe. Now the problem arises that i want to check if the file was ftpd or not. Is there any way i could do this? (4 Replies)
Discussion started by: vikas.rao11
4 Replies

9. IP Networking

Change the root directory for apache, sshd and ftpd

Helo ! I want to do something and I don't know where to start... I want to make a small web hosting server (just for me and a few friends) and for the sake of learning I'd like to make an account for every user. The thing is that I want everyone to log into the server and to be put in his home... (3 Replies)
Discussion started by: Sergiu-IT
3 Replies

10. UNIX for Dummies Questions & Answers

Standalone FTPD within SMF

Hello We are trying to run the WU_FTPD demon in standalone mode (-S argument) via an SMF service. Prior to SMF, this was achieved by simply commenting out the FTP line within the inetd.conf file. However, within SMF, I believe we need to carry out the following activities: i) Remove the FTP... (0 Replies)
Discussion started by: CowsUdders
0 Replies
Login or Register to Ask a Question