Initd permission denied - amazon-web-services

I'm new to Linux and AWS I'm trying to set up an initd script as this code in this gist but getting the following error message, which I think related to permissions but I don't understand what thing needs permissions where.
env: /etc/init.d/geoserver: Permission denied
I've tried the following to resolve it;
[ec2-user#ip-xxx init.d]$ sudo chmod +x geoserver start
[ec2-user#ip-xxx init.d]$ service geoserver start
Starting geoserver...
/etc/init.d/geoserver: line 33: /run/geoserver.pid: Permission denied
EDIT: The machine is AWS Linux 2 RHEL 7.6 Maipo

Related

Permission denied (publickey) while signing in to AWS instance

I am using Jenkins to ssh into aws server. I am using .pem file to login to the server. I am using the below command. The server is of the instance type ec2.
+ ssh -o StrictHostKeyChecking=no -i ceyeApp.pem ubuntu#server_ip
but it throws the following error:
+ ssh -o StrictHostKeyChecking=no -i ceyeApp.pem ubuntu#server_ip
Pseudo-terminal will not be allocated because stdin is not a terminal.
Load key "ceyeApp.pem": Permission denied
ubuntu#18.216.231.140: Permission denied (publickey).
Build step 'Execute shell' marked build as failure
It looks like a permissione problem:
Load key "ceyeApp.pem": Permission denied
Is the user using this key able to read it?
Assuming the user is 'foobar' and he is the owener of the key, make sure the key can be read only by him:
chmod 400 ceyeApp.pem
If the problem persists, please issue the command John Rotenstein suggested to have a verbose output of what's happening and figure out what other problem might cause the issue.

DBCA Permission Denied

I'm new on Linux environment.
For this task, I am using Centos 7 in VirtualBox and trying to follow the guide to install Oracle Database 18c XE.
After setting the config and profile, I finally get the oracle to work.
However, when I tried to create a new Database via dbca, the following error prompted.
[project#localhost bin]$ echo $ORACLE_HOME
/opt/oracle/product/18c/dbhomeXE
[project#localhost bin]$ cd $ORACLE_HOME/bin
[project#localhost bin]$ dbca
bash: /opt/oracle/product/18c/dbhomeXE/bin/dbca: Permission denied
I've only created 1 user (project) for this practicing purpose.

Permission Error Running Container in AWS CodeBuild

I'm attempting to run the following command in CodeBuild:
- docker run --rm -v $(pwd)/SQL:/flyway/SQL -v $(pwd)/conf:/flyway/conf flyway/flyway -enterprise -url=jdbc:postgresql://xxx.xxx.us-east-1.rds.amazonaws.com:5432/hamshackradio -dryRunOutput="/flyway/SQL/output.sql" migrate
I get the following error:
ERROR: Unable to use /flyway/SQL/output.sql as a dry run output:
/flyway/SQL/output.sql (Permission denied) Caused by:
java.io.FileNotFoundException: /flyway/SQL/output.sql (Permission
denied)
The goal is to capture the output.sql file. Running the exact same command locally on Windows (adjusting the paths of course) works without error. The issue isn't Flyway or the overall command structure. It's something to do with the internals of running the Docker container on Ubuntu on AWS CodeBuild and permissions there (maybe permissions, maybe something else, I'm open).
Does anyone have a good idea on how to address this?
The container doesn't have write access to the host. You could try the following, which saves the artifact to the container and uses docker cp to copy the artifact to the host.
container=$(docker create -v <flywaymigrationspathonhost>:/flyway/sql flyway/flyway migrate -dryRunOutput=/flyway/reports/changes.sql -schemas=dbo -user=youruser -password=yourpass -url=<yourjdbcurl> -licenseKey=<licensekey>)
docker start -a ${container}
docker cp ${container}:/flyway/reports/changes.sql <hostpath>
You need to enable Privileged Mode for your CodeBuild project.

gcloud components update permission denied

All of a sudden I started getting "Permission Denied" issues when trying to run any gcloud commands such as gcloud components update -- the issue was avoided if I ran sudo gcloud components update but it's not clear to my why the sudo command is suddenly required? I have actually been trying to run a GCMLE experiment and it had the same error/warning, so I tried updating components and still ran into this issue. I have been travelling for a couple days and did not make any changes since these same commands worked a few days ago. Further, I did not changed my OS (Mac High Sierra 10.13.3) -- were there any changes on the Google side that might explain this change in behavior? What is the best course of action to permanently get around this warning?
(conda-env) MacBook-Pro:user$ gcloud components update
WARNING: Could not setup log file in /Users/$USERNAME/.config/gcloud/logs, (IOError: [Errno 13] Permission denied: u'/Users/$USERNAME/.config/gcloud/logs/2018.03.10/XX.XX.XX.XXXXXX.log')
after sudo gcloud components update I was able to kick off a GCMLE experiment, but I also get the same warning (though my job now submits successfully).
WARNING: Could not setup log file in /Users/#USERNAME/.config/gcloud/logs, (IOError: [Errno 13] Permission denied: u'/Users/$USERNAME/.config/gcloud/logs/2018.03.10/XX.XX.XX.XXXXXX.log')
Based on an answer to a similar question, you probably need to change the permissions to the appropriate directories:
sudo chown -R $USER ~/.config/gcloud
That same post suggests that permissions may have gotten out-of-whack by running a gcloud command with sudo.
In most cases, the problem is not caused by the ~/.config/gcloud directory but the installation directory of gcloud which is owned by root:
drwxr-xr-x 20 root staff 640 Jun 20 18:22 google-cloud-sdk
Solution:
You must change permissions for that directory to your user from:
by:
sudo chown -R $USER /Users/$USER/bin/google-cloud-sdk

Permission denied. Error code: 3 Error message from server: Permission denied

I am logging into my amazon aws production box using WinSCP and i have successfully setup Tomcat 6. But in webapps folder when i transfer some webservice i get error as:
Permission denied.
Error code: 3
Error message from server: Permission denied
Please help me out to resolve this issue
You haven't mentioned what instance type you are using, but it sounds like you are on some flavor of Linux. You need to chmod or chown the webapps directory so you can place files there, or you can place them elsewhere (like your home directory), then log in and use sudo mv to move it in place.