susanBuck / e15-spring22

0 stars 0 forks source link

Aliases no longer working when logged into droplet as alternative user #20

Closed luannebe closed 2 years ago

luannebe commented 2 years ago

Hi, For learning purposes, I attempted to increase server security by setting up an alternative user to root. Things don't work exactly as I would expect, so I am wondering if I did something incorrectly. Two questions:

  1. Are these proper ownership settings for my new user (see last line)? Should I be part of the www-data group?

    luannebert@hes:/var$ ls -la
    total 56
    drwxr-xr-x 14 root       root     4096 Jul  8  2021 .
    drwxr-xr-x 19 root       root     4096 Feb  8 18:51 ..
    drwxr-xr-x  2 root       root     4096 Feb 20 06:25 backups
    drwxr-xr-x 14 root       root     4096 Jan 29 22:36 cache
    drwxrwxrwt  2 root       root     4096 Jan 30 06:25 crash
    drwxr-xr-x 50 root       root     4096 Jan 30 06:37 lib
    drwxrwsr-x  2 root       staff    4096 Apr 15  2020 local
    lrwxrwxrwx  1 root       root        9 May 18  2021 lock -> /run/lock
    drwxrwxr-x 11 root       syslog   4096 Feb 20 00:00 log
    drwxrwsr-x  2 root       mail     4096 May 18  2021 mail
    drwxr-xr-x  2 root       root     4096 May 18  2021 opt
    lrwxrwxrwx  1 root       root        4 May 18  2021 run -> /run
    drwxr-xr-x  6 root       root     4096 Jan 29 20:40 snap
    drwxr-xr-x  5 root       root     4096 Jul  8  2021 spool
    drwxrwxrwt  5 root       root     4096 Feb 20 19:09 tmp
    drwxr-xr-x  5 luannebert www-data 4096 Feb 12 18:40 www
  2. It seems that the aliases (restart, e15) work when I am connected as root, but do not work when connected as luannebert. For example:

    
    luannebert@hes:~$ restart

Command 'restart' not found, did you mean:

command 'rstart' from deb x11-session-utils (7.7+4) command 'restartd' from deb restartd (0.2.3-1build1)

Try: apt install

dauger27 commented 2 years ago

I'm not certain about the permissions question you asked, but I can help regarding the aliases. The aliases set up were account-specific. If you want the aliases to work with the luannebert account, you'll just need to create them a second time within that account.

susanBuck commented 2 years ago

@dauger27 is spot on with how to fix the aliases. Just repeat the steps of setting up the aliases while logged into your new account.

Your permissions on the www directory look correct. The group of the www directory is www-data by default.

Let me know if you're running into any permission-related problems since making the changes.

luannebe commented 2 years ago

Worked like a charm ... all good now. Thanks @dauger27 and @susanBuck

susanBuck commented 2 years ago

Excellent! Going to close this thread, but feel free to re-open or start a new one if any issues arise.