DDclient and a few other questions

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
prodarwin

DDclient and a few other questions

Post by prodarwin »

Greetings all.

I've installed DietPi, have it up and running with a LLSP webserver. My question is now, how do I point this to my domain? I have a domain& dynamic DNS from Namecheap.

In the past I've used ddclient to do this. I'm guessing I can install it on this pretty easily. If so, how do I then configure it so the service starts automatically when the system is rebooted?

Also, once I get that working, what's the recommended method to allow me to access this from outside my home network?

Port forward 80 to 80
22 (ssh) to xxxxx?
21 (ftp) to xxxxx?

Then I can access by just trying to ftp to mydomain.com:xxxxx?

Do I need to setup a certain username/password to do this? Is allowing the root user to do this a bad thing (I see this is disabled on other images I've messed around with)? If I do need a user created to access from the outside, how do I ensure they can access the /var/www directory? I've had huge problems with this in the past with ArkOS (even locally).

All I really want to do is a simple html webserver, and allow myself to easily upload/change files remotely.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: DDclient and a few other questions

Post by johnvick »

prodarwin wrote:Greetings all.

I've installed DietPi, have it up and running with a LLSP webserver. My question is now, how do I point this to my domain? I have a domain& dynamic DNS from Namecheap.

In the past I've used ddclient to do this. I'm guessing I can install it on this pretty easily. If so, how do I then configure it so the service starts automatically when the system is rebooted?

Also, once I get that working, what's the recommended method to allow me to access this from outside my home network?

Port forward 80 to 80
22 (ssh) to xxxxx?
21 (ftp) to xxxxx?

Then I can access by just trying to ftp to mydomain.com:xxxxx?

Do I need to setup a certain username/password to do this? Is allowing the root user to do this a bad thing (I see this is disabled on other images I've messed around with)? If I do need a user created to access from the outside, how do I ensure they can access the /var/www directory? I've had huge problems with this in the past with ArkOS (even locally).

All I really want to do is a simple html webserver, and allow myself to easily upload/change files remotely.
Maybe your router can do what DDclient does? Many can. And the steps above should work OK, I do the same here. Have a look at owncloud for uploading files to your device.

Maybe think about changing the SSH port from 22 to another for better security.
prodarwin

Re: DDclient and a few other questions

Post by prodarwin »

Thanks.

DDclient actually turned out to be a piece of cake to setup. I just used

Code: Select all

sudo apt-get install ddclient
then edited

Code: Select all

/etc/ddclient.conf
to reflect my information. Then I modified

Code: Select all

/etc/default/ddclient
and set

Code: Select all

run_daemon="true"

I also decided not to use FTP. I switched my SSH software to OpenSSH to SFTP is supported.

Now I need to figure out the following:

1) How do I create a user that only has access to the /var/www directory?
2) How do I only allow this user to connect via SFTP?
User avatar
Fourdee
Site Admin
Posts: 2787
Joined: Tue Feb 06, 2007 1:36 pm

Re: DDclient and a few other questions

Post by Fourdee »

prodarwin wrote: 1) How do I create a user that only has access to the /var/www directory?
You will need to create the user, then assign permissions to that user (replace "username" accordingly):

Code: Select all

adduser username
chown -R username:nogroup /var/www
chmod -R 700 /var/www
Now, only the user "username" (and always "root") can access /var/www.

You can check the permissions on /var/www with:

Code: Select all

ls -lha /var/www
2) How do I only allow this user to connect via SFTP?
Honestly not sure. if noone can provide you with an solution, please bump the thread and i'll look into it.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply