Can't upload an image to my server - linux

I would like to upload my logo image to the website. To upload it to the Linux server from my computer, i created a directory "media" in the /var/www/html and tried this command:
scp /Users/kateryna/Desktop/my_site/pics/Logo.png root#95.142.160.135:/var/www/html/media
After this I entered the password to the server and then nothing happened, I got an error:
/Users/kateryna/Desktop/my_site/pics/Logo.png: No such file or
directory
.... even though the file exists on my machine.
Why does it happen? maybe I need to give some sort of permission? I read in one of the articles that to allow an upload, my folder permissions must be set to 777 with the command sudo chmod 777 /path/to/upload/folder... tried that for a different directory and didnt work either:
root#production-381d063e:~/new/myMedia# sudo chmod 777 /root/new/myMedia
-bash: sudo: command not found
root#production-381d063e:~/new/myMedia# chmod 777 /root/new/myMedia
root#production-381d063e:~/new/myMedia# scp /Users/kateryna/Desktop/my_site/pics/Logo.png root#95.142.160.135:/root/new/myMedia
root#95.142.160.135's password:
/Users/kateryna/Desktop/my_site/pics/Logo.png: No such file or directory
root#production-381d063e:~/new/myMedia#
Thanks so much!!!!!

Related

reading jar file error

enter image description here
I was trying to run tomcat and I think these red files are causing problems.
does anyone know why I cant read .jar files?
Do a sudo ls -la in the same directory to check for permissions of these files.
Maybe you don't have proper read permissions for those files in red. To give read access use command like this sudo chmod ug+r bootstrap.jar. To give write access too sudo chmod ug+rw bootstrap.jar

Change permission folder in Raspberry Pi to R permission

The image below contain the command that change the permission for folder:
I want to change permission folder in Raspberry Pi to r permission it is folder for radio in /var/www. It failed and said "chmod: invalid mode: '-R' try chmod :--help to more information".
As already mentioned -R is not a permission, rather it's an option that sets the recursive mode on. The command you want is:
sudo chmod 777 -R PiFmRds/src
Note: chmod 777 is a dangerous permission setting. It means that literally everyone and everything can read, write, and execute the directory and everything below it.

Permission denied while cloning project in htdocs

I am new to linux and I am trying to clone a project into a folder that am currently in contained in opt/lampp/htdocs using the command git clone git#gitlab.com:whatever . but i am getting a permission denied error. What can i do to resolve this issue
update httpd.conf
sudo gedit /opt/lampp/etc/httpd.conf
Find
User nobody
Group nogroup
Replace nobody with your username
Change the ownership of htdocs
sudo chown -R username:username /opt/lampp/htdocs
Change the file permissions of htdocs folder
sudo chmod -R 775 /opt/lampp/htdocs/
Restart your machine
Clear your browser cache
You can also give the folder full permissions like this:
sudo chmod -R 777 /opt/lampp/htdocs/
or sudo chown -R $USER:$USER /opt/lampp/htdocs
I already have my username correctly wrote in user in the httpd.conf file, and still had the same problem. Finally, I found the solution changing the port number:
In the same file look for Local:8888 and change 8888 to 80
try to give full permission to your htdocs folder
sudo chmod 777 opt/lampp/htdocs
Then it will ask for password enter and go ahead. learn More Here :)
Permission denied is exactly what it says. You do not have permission to write to this folder. You can either git clone the repo as a root using sudo git clone (...) or change permissions to this folder. sudo chmod a+w <path> and then git clone it normally. You can also clone the repository to some other folder to which you already have permissions to write to.

Django, I am getting "Permission Denied" when trying to access a directory that is given to an ftp user

My django application (v1.8) is using a directory for exporting some csv files. This directory is something like: "/home/username/django_project/csv_out".
I have intentionally chmod the "csv_out" dir to 777.
My partner wanted to access this directory in order to download and inspect those csv files.
I created an FTP user like this:
useradd ftp_user -p somepassword -d /home/username/django_project/csv_out/ -s /bin/false
Since then I get a "Permission Denied" error from Django (was not getting that error before): The FTP Server is giving access to the folder without problem. Django "misbehaves".
IOError: [Errno 13] Permission denied: '/home/username/django_project/csv_out/weights_1.csv'
Am I doing something wrong?
PS: I am using proftpd ftp server
You also need +x (search) permission on /home/username and /home/username/django_project/ directories for ftp_user
Try this
chmod a+x /home/username
chmod a+x /home/username/django_project/
note your ftp user is different from your website user.
which user account you started your django website?

ls and chmod not working on a nfs mounted file

I mounted a directory using nfs. I am able to cd into the mounted directory and able to list the
one file in the directory. But when I try a ls -li on the file, it keeps failing with
ls: rst_dst/testnew1: Permission denied.
I tried to chmod the file but it keeps failing with chmod: failed to get attributes of 'rst_dst/testnew1': Permission denied. Even the stat command keeps failing with 'Unable to stat the file'.
I tried a sudo ls/chmod but it fails with the same errors.
I am able to chmod the file on the actual machine hosting the directory. But unable to read/write/modidy the permissions through the mounted directory.
Am I missing something?
On hosting machine check file /etc/exports which permissions you allow.
On guest machine check your mount command or line in /etc/fstab with which permissions you are mounting it.

Resources