You have two unrelated problems.
"403 Forbidden" is a web server error. You have to fix your URL.
When you ran
wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz, you got a
403: Forbidden error. This is an error from the web server and is unrelated to the user account used to download the file.
When you attempt to load a page or download a file and you specify an incorrect URL, a
404: Not Found errors is the most common result. But a 403 error can occur sometimes in this situation, and that appears to be what is happening here. It looks, from both the command you ran and
wget's output, like you forgot to put the actual version numbers in the URL.
On my system, I am able to get exactly the same error using the URL with
X.X.X instead of an actual version number:
ek@Io:~/Downloads$ wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz
--2017-01-17 03:15:30-- https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz
Resolving releases.mattermost.com (releases.mattermost.com)... 126.96.36.199, 188.8.131.52, 184.108.40.206, ...
Connecting to releases.mattermost.com (releases.mattermost.com)|220.127.116.11|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2017-01-17 03:15:32 ERROR 403: Forbidden.
And if I use the correct URL, it works:
ek@Io:~/Downloads$ wget https://releases.mattermost.com/3.6.0/mattermost-team-3.6.0-linux-amd64.tar.gz
--2017-01-17 03:09:50-- https://releases.mattermost.com/3.6.0/mattermost-team-3.6.0-linux-amd64.tar.gz
Resolving releases.mattermost.com (releases.mattermost.com)... 18.104.22.168, 22.214.171.124, 126.96.36.199, ...
Connecting to releases.mattermost.com (releases.mattermost.com)|188.8.131.52|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27221349 (26M) [application/x-gzip]
Saving to: ‘mattermost-team-3.6.0-linux-amd64.tar.gz’
mattermost-team-3.6.0-linux- 100%[==============================================>] 25.96M 106KB/s in 2m 6s
2017-01-17 03:11:58 (212 KB/s) - ‘mattermost-team-3.6.0-linux-amd64.tar.gz’ saved [27221349/27221349]
(Both the working and non-working URLs are from your post. I don't actually know exactly what file you need.)
The mattermost user isn't a sudoer.
Not all users may run programs as root (or at all) with the
sudo command. The file
/etc/sudoers, or a file in
/etc/sudoers.d, must be configured to allow them to do so. Most commonly, this is achieved by putting the user in a group that one of those files permits to run commands.
In particular, to make a user an administrator on an Ubuntu system so that they are permitted to run any command as root using
sudo, add the user to the
sudo usermod -aG sudo mattermost
Of course, you must run that as a user who can run commands as root with
sudo already. (You were able to run
sudo passwd mattermost, so I know you have at least one such user.)
Keep in mind:
- You must only do this if you really want that user to have full power to do anything. They will have the same power as you. Once you've decided you want that, though, you should go ahead and simply add the user to the
sudoers group. There is usually no need to actually edit any configuration files for
sudo -- they're already set up to recognize the
sudo group as conferring administrative power.
- If for some reason you instead choose to edit
/etc/sudoers or create/edit a file in
/etc/sudoers.d, it is important that you use the
visudo utility to do it, because it performs a syntax check to make sure your changes will be understood by
sudo sees incorrect syntax in a sudoers file, then it will completely refuse to work. For servers you only have remote access to, this can lock you out of the system.
Finally, it's very rare that you actually have to manually download a file with
wget as root. In this case, you didn't -- the error was an incorrect URL and the "forbidden" message was from the web server. Therefore:
- If this is the only reason mattermost needed to use
sudo, you probably shouldn't give that user account these abilities, because there's no need.
- Even if mattermost really does need to be an administrator, they should perform actions as themselves (without
sudo) rather than as root (with
sudo) except when there is a clear reason to do the latter.