I had a user account in Ubuntu called my_account
. Then I created another account called test_account
. When I do wget in my_account
, it works:
my_account@my_machine:~$ wget --no-check-certificate https://hdfs_server:50470/webpage.html#tab-datanode
--2018-02-09 14:37:30-- https://hdfs_server:50470/webpage.html
Resolving hdfs_server (hdfs_server)... 192.168.xx.xx
Connecting to hdfs_server (hdfs_server)|192.168.xx.xx|:50470... connected.
WARNING: cannot verify hdfs_server's certificate, issued by ‘CN=abc CA3,DC=def,DC=ghi,DC=org,DC=jkl’:
Self-signed certificate encountered.
WARNING: cannot verify hdfs_server's certificate, issued by ‘CN=abc CA3,DC=def,DC=ghi,DC=org,DC=jkl’:
Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: 13320 (13K) [text/html]
Saving to: ‘webpage.html’
webpage.html 100%[===================>] 13.01K --.-KB/s in 0.002s
2018-02-09 14:37:30 (5.33 MB/s) - ‘webpage.html’ saved [13320/13320]
But when I do wget in test_account
, it gives this error:
test_account@my_machine:~$ wget --no-check-certificate https://hdfs_server:50470/webpage.html#tab-datanode
--2018-02-09 14:29:52-- https://hdfs_server:50470/webpage.html
Resolving hdfs_server (hdfs_server)... 192.168.xx.xx
Connecting to hdfs_server (hdfs_server)|192.168.xx.xx|:50470... connected.
WARNING: cannot verify hdfs_server's certificate, issued by ‘CN=abc CA3,DC=def,DC=ghi,DC=org,DC=jkl’:
Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: 13320 (13K) [text/html]
webpage.html: Permission denied
Cannot write to ‘webpage.html’ (Success).
I am using test_account
as superuser (i.e., su test_account
). So, why can't wget write files into the system with test_Account
? And how can I fix it?
I found the reason. Turns out,
test_account
was not set up properly when created like sosudo useradd -m -d /home/test_account test_account
, as shown by the differences in owners betweenmy_account
andtest_Account
:As can be seen,
test_account
does not have any owner, whilemy_Account
does. So, to fix this, I did the following:After this, we can see that
test_account
belongs to the proper group, and wget works:Just thought I should post my solution in case someone facing the same issue might stumble upon it.