PDA

View Full Version : Can I start KNOPPIX Samba service from the commandline



pau1knopp
01-27-2005, 02:36 PM
What I would like to be able to do is to ssh into a newly booted knoppix livecd (with ssh started) from a remote workstation and start the samba service from the command line instead of having to do the initial start (enter password twice, export drives y/n) from the command line of the remote terminal.

Any suggestions?

~pau1

Cuddles
01-27-2005, 05:50 PM
What I would like to be able to do is to ssh into a newly booted knoppix livecd (with ssh started) from a remote workstation and start the samba service from the command line instead of having to do the initial start (enter password twice, export drives y/n) from the command line of the remote terminal.

Any suggestions?

~pau1

Havent worked with Samba, but, here is my guess...

I looked at /etc/init.d folder, and found that a "samba" shell script exists, upon examination, it appears the script is "standard" start / stop form... i.e. init.d scripts "expect" to be passed a parameter of either start or stop, and then either start the services, or stop them, depending on the passed parameter....

My best guess here, is, the following command should do the trick:

/etc/init.d/samba start

and to stop, the following:

/etc/init.d/samba stop

you probably want to do this as a root, not sure though...

Hope this has helped,
Ms. Cuddles

pau1knopp
01-27-2005, 06:32 PM
You can only start a preconfigured service (password, export drives y/n) this way. Essentially, I would like to start the service (including configuration) from the command line.

Good input Ms. Cuddles, I'll keep digging and post results here unless someone else has the answer.

Regards,

Paul

Jamesc359
01-28-2005, 12:36 AM
I'm not sure. But I think this is what you want.

start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- -D --configfile=YOURCONFIGFILE
start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- -D --configfile=YOURCONFIGFILE

start-stop-daemon --stop --quiet --exec /usr/sbin/nmbd
start-stop-daemon --stop --quiet --exec /usr/sbin/smbd

FYI: nmbd is the NetBIOS name server and smbd is the Samba server daemon

.::EDIT::.
Cuddles is right. You need to do all this under root. After all, only root can open ports below 1024.

pau1knopp
01-28-2005, 03:53 PM
Excellent input...

What is the format of YOURCONFIGFILE? Is this smb.conf?

~pau1

Jamesc359
01-29-2005, 02:40 AM
Yep. Everything you would ever want to know about that can be found at http://www.samba.org/samba/docs/man/smb.conf.5.html and a quick howto guide can be found at http://www.faqs.org/docs/securing/chap29sec284.html