setting ssh permission in hadoop installation - hadoop

I'm trying to install hadoop for the first time and I'm following this tutorial http://www.youtube.com/watch?v=xrxQXfE7t9A & https://sites.google.com/site/howtohadoop/how-to-install-hdp#bmec2
What I'm trying to do is setting up the master node to access the other slave node. So, when it comes to set the permission for the /root/.ssh folder by "chmod 700 /root/.ssh" an error message is displayed that I do not have permission.
I couldn't understand why this message? Why I do not have permission?
any help?

You don't have permission since you are not logged in as root and trying to play with the files owned by root. Run sudo chmod 700 /root/.ssh . sudo makes you run commands as root on the system.

Related

Laravel - Every new day I have this error : failed to open stream: Permission denied

i tried by giving permission (775) to bootstrap/cache and storage folder - it works fine on that day but next day it gives error again with new created log file.
The stream or file "/var/www/public_html/myProject/storage/logs/laravel-2021-03-31.log" could not be opened in append mode: failed to open stream: Permission denied in /var/www/public_html/myProject/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:111
i found the solution here:
i have two users on linux server
1 : ubuntu
2 : www-data
i added ubuntu user to www-data group and same as wwww-data to ubuntu group.
so now both users can read there files,
second thing i did is -> i updated app/config/logging.php
and define the permissions (0666) for newly created log file for "daily" and "single".
This might help you:
sudo chown -R www-data:www-data /var/www/{laravel_project_name}
link:
https://dev.to/613596/permission-denied-for-laravel-8-storage-logs-solved-2021-12ld
You have permission issue in your path /var/www/public_html/myProject/storage/logs/.
Try to run the following command
Change the files/directories group to apache/nginx, I used www-data it's the default user of apache on Ubuntu (Use your http server user/group name instead of www-data)
sudo chown :www-data -R /var/www/public_html/myProject/storage/
Now change the file permission once again
sudo chmod 775 -R /var/www/public_html/myProject/storage/
You can also add UID, GID, SID to handle more efficiently

Laravel 5.5: laravel.log could not be opened: Permission denied

I'm trying to run a simple Laravel command line on my Elastic Beanstalk instance: php artisan queue:work
But I keep getting the following error:
In StreamHandler.php line 107:
The stream or file "/var/app/current/storage/logs/laravel.log" could
not be opened: failed to open stream: Permission denied
I've tried every solution I can find on SO (except the chmod -R 777 advice that seems to trail this question everywhere).
I've tried deleting the existing laravel.log and then using touch to create a new one, and then making sure webapp is the owner.
I've also tried:
sudo chmod -R 755 /var/app/current/storage/
sudo chown -R webapp /var/app/current/storage/
When I list the logs directory, everything looks as I think it should:
-rwxr-xr-x 1 webapp webapp 0 Apr 4 14:38 laravel.log
The storage directory also looks fine:
drwxr-xr-x 6 webapp webapp 4096 Apr 3 19:33 storage
But I'm still getting the above error! Can anyone explain why (not just give a solution).
Thank you
So the simple answer is that I was running the command as ec2-user. As a solution, I could either:
Change the ownership of laravel.log to ec2-user
Run the command as the owner (eg. sudo -u webapp php artisan queue:work)
Switch to root with sudo su to see how it would be run during deployment (ie. as root)
Nothing was especially wrong.
When you log into an EBS instance via ssh, you're logged in as ec2-user.
I don't believe the ec2-user is part of the webapp group which is actually executing PHP & apache/nginx.
Try adding your ec2-user to the webapp group by creating an ebextension in the root of your Laravel project under .ebextensions/ec2user.config
users:
ec2-user:
groups:
- webapp
Prove this is the problem by turning off selinux with the command
sudo setenforce 0
This should allow writing, but you've turned off added security server-wide. That's bad. Turn SELinux back
sudo setenforce 1
Then finally use SELinux to allow writing of the file by using this command
sudo chcon -R -t httpd_sys_rw_content_t storage
And you're off!

PhpStorm - Deployment - Cannot Upload New Files

When I try to create a new file/folder in PhpStorm I get a Permission denied error. However, when I create a new file in a folder that already exists in the root directory of my server I can without any errors.
When I try to create a new file:
[2016-03-07 11:29 AM] Failed to transfer file 'C:\Users\D\PhpstormProjects\example2\test.php': could not write to "sftp://www.example.com/test.php". (Permission denied)
[2016-03-07 11:29 AM] Automatic upload completed in less than a minute: 2 items failed
When I try to create a new folder:
[2016-03-07 11:27 AM] Failed to create folder '/var/www/html/test': could not create folder "sftp://www.example.com/test". (Permission denied)
[2016-03-07 11:27 AM] Automatic upload completed in less than a minute: 1 item failed
You can try this :
chmod -R 777 /var/www
chgrp www-data /var/www
chown -R www-data /var/www
useradd -G {www-data} your_username
The issue solved itself after restart.
PhpStorm support gave this answer:
Please try to run File > Invalidate Caches/Restart > Invalidate and Restart.
If it still fails please send me idea.lof file as described here:
https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files
Prior to deleting, modifying and transferring files, you need to give them the permissions to the data group for the user who will perform the operations.
$ sudo usermod -a -G www-data your_username
$ sudo chgrp -R www-data /var/www/html
$ sudo chmod -R g+w /var/www/html
Checklist:
Make sure you own the files, so if you are in the sudo group then you can do sudo chown -R myusername:sudo /var/www/html/test/. This is to make sure that it will also work for other people in the group.
Make sure that you have write permissions, i.e. read and write access also for the group. You can do this with sudo chmod -R 755 /var/ww/html/test/ (Unfortunately I have found that in practice you sometimes need 777 permissions, but this is not desirable.)
Make sure your deployment path mappings are correct, by going to Settings | Deployment | Mappings, and check that the Deployment path is indeed relative to the root path (under Connection)
After fixing permissions on server you need restart phpstorm. Worked for me on Ubuntu 17.10

Jmeter Server with modified execute(allowed) permission still not executable

I am trying to do a distributed testing to JSON APIs. But in Ubuntu 14.04, Jmeter-server (the slaves) just don't run. I have tried chmod +x, going root, even the hazards of chmod 777. But still, when you execute "./jmeter-server", permission denied still appears. Why is this so?
Make sure you also chmod +x on the /bin/jmeter file.
/bin/jmeter-server in turn calls /jmeter to start.

owncloud cannot access directory

I am running Raspbian version 7 on my raspberry pi. I am running owncloud on this. I have mounted an external drive under /media/Owncloud. This is where I have owncloud store all the files. I cannot access this directory. When I try cd /media/Owncloud it gives me the following error:
-bash: cd: /media/Owncloud/: Permission denied
How can I access this directory?
OwnCloud and external hard drives are tricky and you have a permission issue. For some reason, trying to make a link to an external hard drive has issues, so you need to try mounting your external hard drive.
External hard drive - Apply the proper group and read permissions:
chown -R www-data:www-data /media/user/your_hard_drive/owncloud_data/
chmod -R 777 /media/user/your_hard_drive/owncloud_data/
Local hard drive - Apply the proper group and read permissions:
mkdir /var/www/owncloud/data
chown -R www-data:www-data /var/www/owncloud/data
chmod -R 777 /var/www/owncloud/data
Make the mount of local hard drive to external hard drive
mount --bind /media/user/your_hard_drive/owncloud_data/ /var/www/owncloud/data/
Source:
https://manandkeyboard.wordpress.com/2014/09/15/owncloud-and-an-external-hard-drive/
If you just want to cd into the directory, change to root with sudo -i.
In order to access /media/Owncloud, you need to set the proper permissions. Run the command sudo chmod 755 /media/Owncloud(for more security relative to permission 777).
You also may need to allow to webserver to access the directory. In order to do that, run sudo chown -R www-data:www-data /media/Owncloud
Sources:
My own experience and frusteration in running into the exact same problem
http://www.instructables.com/id/Raspberry-Pi-Owncloud-dropbox-clone/?ALLSTEPS A great albeit somewhat outdated guide to set up owncloud on a Raspberry Pi.
The issue is with wrong permissions.
If the webserver runs as user www-data, the mounted folder must be somehow accessible to that user
either that user must be owner of mounted folder and its contents, and have the "user" permissions, or
the the folder must be accessible to the group the webserver user is in (usually www-data).
To see the current permissions use the ls -l command.
To change the owner use chown command,
to change the permissions for the user-owner, and group-owner, use the chmod command,
or just use Midnight commander (mc) or some GUI to do that.
If you are mounting the external volume through /etc/fstab check the options in there. I would not recommend using the volume with some dynamic mounting (like the file managers do (gvfs-fuse)) if is a key folder for a webserver with ownCloud and you need to have it auto-mounted on boot, as some specific user that the webserver is run as.
I have an experience with having the ownCloud data folder on /srv/data (also ownCloud 7.0 on Ubuntu Server 14.04 VPS), the permissions are 770 and the owner is www-data:www-data, and in the ownCloud config file, I use the line
'datadirectory' => '/srv/data',
I would not recommend using 777 permissions, as it is not a good security practice in general.

Resources