LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-22-2007, 07:31 PM   #1
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Rep: Reputation: 15
sshd appears not to start sftp-server


Hi all,

I am currently trying to get an internal network going with some nodes booting remotely from server. The nodes should boot and then mount a series of directories on the server. Everything seems to be working, with the nodes being assigned the proper IP address, however the nodes tell me their DHCP request was answered by 0.0.0.0 (which is not the address I have given the server using ifconfig). Following this, 0.0.0.0 is given as the address for the bootserver and rootserver. As this address is incorrect, mounting fails.

I assume that I need sftp-server running on the server. sshd is running, but I can't find any evidence of sftp-server being started, even though I have an entry

Subsystem sftp /usr/libexec/openssh/sftp-server

in the file /etc/ssh/sshd_config.

So, my first question is; how do I get sshd to start sftp-server?
Second, does sftp-server not running seem likely to cause the problems I am having? If not, what else should I check?

Any help would be appreciated, I can post more info if required.

Thanks,
 
Old 01-22-2007, 08:24 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
I'm a little confused. It would seem to me you would want the sftp running all the time. Why would you only want it running when you ssh in?

The sftp package probably cam with install scripts, but if it didn't you can probably copy some of the scripts is /etc/init.d and make the changes so it will start|stop|restart sftp.

I don't think sshd would have the ability to start system services. That would require root level access, and although ssh requires root level access to start, I don't think it would allow root level access to start other services, that would be a huge security problem.

So get sftp started and running all the time, then you should be cool. This code should tell you is sftp is running or not.

Code:
ps aux|grep sftp
Peace,
JimBass
 
Old 01-22-2007, 09:10 PM   #3
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
JimBass,

Sorry, I do want the sftp-server running all the time. From what I have read, it should be started by sshd, if the Subsystem option is given in sshd_config. But this seems not to happen for me. The output of ps aux| grep sftp is

root 15191 0.0 0.0 3880 680 pts/2 S+ 14:06 0:00 grep sftp

which, to me, shows that sftp is not running. So, my question is: how do I get it running?

Thanks,
 
Old 01-22-2007, 09:20 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Seeing you run Fedora Core, I think they have a program called chkconfig or something like that. It is a tool to start programs at boot. You should run that, telling sftp to start all the time with the boot process. There also should have been a script put into /etc/init.d that would be named sftpd or something along those lines, and that can start the process as well.

if chkconfig doesn't have sftp or sftpd as options, then please post the output of the command:
Code:
ls -al /etc/init.d/s*
Peace,
JimBass
 
Old 01-22-2007, 10:03 PM   #5
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
JimBass,

Thanks for the prompt reply. Nothing like sftpd shows up in chkconfig, however, there is something called vsftpd, but running it does not improve the situation. Output of ls -al /etc/init.d/s* is as follows:

-rwxr-xr-x 1 root root 1547 Sep 30 07:14 saslauthd
-rwxr-xr-x 1 root root 3349 Sep 5 23:27 sendmail
-rwxr-xr-x 1 root root 647 Jul 21 2006 single
-rwxr-xr-x 1 root root 2523 Aug 19 06:53 smartd
-rwxr-xr-x 1 root root 2087 Sep 2 12:59 smb
-rwxr-xr-x 1 root root 1566 Aug 3 03:44 spamassassin
-rwxr-xr-x 1 root root 3283 Oct 2 20:17 squid
-rwxr-xr-x 1 root root 3095 Oct 3 03:39 sshd
-rwxr-xr-x 1 root root 2012 Sep 13 20:52 syslog

So, the ssh daemon is launched at startup, but it does not seem to start the sftp-server as expected. Any thoughts?

Thanks,
 
Old 01-22-2007, 10:22 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
The sshd deamon won't be able to start sftp. I covered that earlier. Beyond all else, why would you want sshd to start something else? That makes no sense to me.

Vsftp is the very secure ftp daemon. That is a great program in an of itself, but won't help your sftp any. I would reset that to the original settings it had if you can.

How did you build the sftp package? Did you compile it from source, install the rpm?

If you simply type /usr/libexec/openssh/sftp-server & what happens?

If that launches the sftp program, we might be able to craft a startup script for it, but really one should have been included in the package used to install sftpd.

Peace,
JimBass
 
Old 01-22-2007, 10:34 PM   #7
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
JimBass,

Thanks for your help, and apologies, as I think I have wasted a lot of your time. The sftp-server is started without problems when a client establishes and sftp connection. I checked this by running sftp localhost, and then checking ps -ae | grep ftp. Sure enough, I have both sftp and sftp-server running. Again, my apologies for asking such misdirected questions, and then not really grasping what you were telling me.

However, this now leads me back to my original problem of getting my nodes to remote boot. It seems to me that the main problem is that they don't "see" the IP address of the server, and so have all sorts of issues when trying to transfer files back (it all makes sense now, why my sftp-server was not running, as none of my nodes were actually attempting to make a connection with the right machine).

Is there someting more than configuring the ethernet interface with ifconfig? Again, sorry for the previous stupid questions.

Thanks,
 
Old 01-22-2007, 10:42 PM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
It's not a problem at all. Glad my answers inspired you to figure out your own solution!

I may be completely wrong about this as I haven't played with it in years, but I think you want tftp (trivial ftp) running for clients to boot off of it? sftp won't work for booting I believe, because they need user/name password info to get to it. I could be wrong as I said, but look into that.

Peace,
JimBass
 
Old 01-22-2007, 11:01 PM   #9
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
JimBass,

I will check out the tftp issue. If I get anywhere, I will post here to let you know the outcome.

Thanks again for all your help,
 
Old 01-22-2007, 11:49 PM   #10
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
sftp is a sub-system of OpenSSH--it's built-in by default.

You need tftp in order to give your diskless systems a boot image. If your DHCP server is handing out 0.0.0.0 as the boot server, that's wrong. You need to carefully specify the server in your DHCP configuration to tell your diskless clients where to request their image from and where to mount their file system.
 
Old 01-23-2007, 12:17 AM   #11
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Original Poster
Rep: Reputation: 15
Chort,

What option do I need to set in the dhcpd.conf file to specify the dhcp server address? What I have at the moment that relates to this is:

ddns-update-style ad-hoc;
ignore client-updates;

subnet 11.0.0.0 netmask 255.255.255.0 {

# --- default gateway
option routers 11.0.0.1;
option subnet-mask 255.255.255.0;

The IP address I have set for eth1 (the interface for the local subnet) is 11.0.0.1 (obviously not 0.0.0.0).

Is there something I am missing?

Thanks,
 
Old 01-23-2007, 12:51 AM   #12
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
This is stolen from the dhcpd.conf man page, which you can read in full by googling for it, or typing man dhcpd. In any case,
Code:
Imagine  that  you  have  a site with a lot of NCD X-Terminals.   These
       terminals come in a variety of models, and you want to specify the boot
       files for each model.   One way to do this would be to have host decla-
       rations for each server and group them by model:

       group {
         filename "Xncd19r";
         next-server ncd-booter;

         host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
         host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; }
         host ncd8 { hardware ethernet 0:c0:c3:22:46:81; }
       }

       group {
         filename "Xncd19c";
         next-server ncd-booter;

         host ncd2 { hardware ethernet 0:c0:c3:88:2d:81; }
         host ncd3 { hardware ethernet 0:c0:c3:00:14:11; }
       }

       group {
         filename "XncdHMX";
         next-server ncd-booter;

         host ncd1 { hardware ethernet 0:c0:c3:11:90:23; }
         host ncd4 { hardware ethernet 0:c0:c3:91:a7:8; }
         host ncd8 { hardware ethernet 0:c0:c3:cc:a:8f; }
       }
So it seems you would want to specify the MAC of the devices using the bootp service, and you also have to point them at the server holding the bootp image (identified as next-server and filename in the example above).

Here's another example from the man page about having a specific client look in a specific location for a bootp file -

Code:
       subclass "allocation-class-2" 1:08:00:2b:a1:11:31 {
         option root-path "samsara:/var/diskless/alphapc";
         filename "/tftpboot/netbsd.alphapc-diskless";
       }
Peace,
JimBass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSHD Won't Start after Server Reboot Louie55 Linux - Software 2 01-20-2005 08:34 PM
Concepts/Security types/ Setup: OpenSSH/sshd/ssh/scp/sftp Caud Pong Linux - Security 5 09-23-2004 06:51 AM
SFTP only appears to work while someone's logged in to GUI on RH AS 2.1 rar9999 Programming 0 05-27-2004 06:54 PM
Pro FTP appears to start, but doesn't. fireman949 Linux - Software 11 04-20-2004 08:43 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM


All times are GMT -5. The time now is 01:32 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration