1

I'm creating a backup server for movies using ubuntu server and on it I installed ssh, vstpd and samba.

I noticed that samba and the vsftp on the server never start with the booting up of the server. Acessing it on windows file explorer shows this message:

Windows Cannot Access \\(Server name)

Check Spelling of the name (...)

Unless I start putty and use ssh to login into the server. I don't even need to do anything on it because afterwards the server works like a charm, i can even log out from the tty and it still works.

What am i missing here? I thought that samba and vsftp started automatically when the server boots up and not when the user log in. Should i make an automatic login such as in This answer (And this one as well)? I tried it, but it has not worked the way intended.


Output of systemctl smbd status

● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: active (running) since Fri 2018-05-25 16:43:19 -03; 13s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1000 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)
    Tasks: 3
   Memory: 23.2M
      CPU: 233ms
   CGroup: /system.slice/smbd.service
           ├─1012 /usr/sbin/smbd -D
           ├─1021 /usr/sbin/smbd -D
           └─1080 /usr/sbin/smbd -D

May 25 16:43:18 NAS systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
May 25 16:43:19 NAS smbd[1000]:  * Starting SMB/CIFS daemon smbd
May 25 16:43:19 NAS smbd[1000]:    ...done.
May 25 16:43:19 NAS systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).

I did a reboot on the server, waited a little bit, and then a login using date; ssh SeverIp using my Debian notebook and quickly put my password. The date on the second line of the systemctl output above is just 3 seconds after the one on login.

1 Answers1

0

I'm a little confused. Do you just have to log in via ssh and it starts automatically, or do you have to start each service manually after you ssh in?

Usually, the best way to autostart services is to use systemctl. First, type systemctl status smbd and you should get an output like this if it is running: enter image description here

On the second line, it says enabled which means it will start when it boots up. If it is not running, you can start it by typing systemctl start smbd. It will then ask for your password to authenticate, after which the service starts running. If it is not enabled, you can then type systemctl enable smbd to have it start when the system boots. When you enable it, it will ask for your password twice. You can do the same thing with vstpd and most services (including ssh), just replace the smbd part of the commands.

GRRegis
  • 53