Access denied for files owned by apache [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to migrate data from onw of my VPS to another. The problem is, for the VPS from where I am moving the files, I don't have root access, and most of the user uploaded content in there are owned by apache, and hence when I tried rsync I got access denied. I tried chown from the account I do have access to, but it seems that account can't change the owner of those files(but I might be doing it wrong as well, since I am new to SSH. So please tell me the correct syntax to recursively change ownership of all files within a folder and subfolders. I tried chown -R dirname/*). So is there any other way to move these files?
Also, if I reset the password(I am on godaddy linux-VPS), will it affect my site or cause any downtimes? If I get root access, will it help in this matter?

Resetting your password on your Go Daddy Linux VPS should not cause any downtime. The password reset should just change the user and root passwords. Once you are logged in to the server as your user you will then use the "su" command to change to the root user. You cannot log in directly as root. The command will look like this:
#su -
Once logged in as root you should be able to do the rsync without issues.

Related

In linux,who can be a root user? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I were using windows but now I am shift to unix like os sucn as linux,fedora .Now I am confused what is root in linux os?Please explain me.
Root user is also known as superuser in Linux-based OS. Basically, root user is granted all permission to do various task on that system. This includes adding/removing normal user account, managing services, changing ownership of files/folder and many more.
Normally, it is recommended for system administrator to create another normal user account to perform day-to-day operations while root account should only use when necessary. Once the system administrator has completed the necessary task, he/she will then revert back to their normal user account immediately. It is because a mistyped of command using root account might lead to wiping all data in the system!
For more information about root, you can visit here and here. Hope it helps.

Why are Linux file permissions so primitive? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Why are Linux file permissions still so primitive and is this likely to ever change?
Each file/dir can only have an owner and group. This seems to make the following things extremely difficult to implement:
How can you make a file read only and not delete-able, but still give that user permission to write to its directory?
How can you restrict directories to only certain users with out having to create a group for every possible combination of users required? And having done that its useless anyway because anyone who creates a file doesn't get it's permissions inheretted, so every user has to explicitly change the permissions on every file they make just so others can edit it.
I have found myself having to modify my programs to set the permissions of a file to the directory where it is saved to just to avoid user frustration.
How do you handle these sorts of things on desktop systems with non power users?
You can use the ACLs to have an advanced control on file and directory permissions.
An example (for Archlinux in this case) is here: https://wiki.archlinux.org/index.php/Access_Control_Lists
Have you tried using Access Control Lists ? see the setfacl command for an overview.
The issue of inheriting incorrect permissions is discussed at linuxquestions.org. Below is a summary of the proposed solution.
#mkdir tech
#chown root:tech tech/
#chmod g+s tech/
#chmod 0750 tech/
#setfacl -d -m g:techAdmin:rwx tech/
#setfacl -m group:techadmin:rwx tech/
The above will create a new directory tech which is owned by the tech group. The user group techAdmin will have access to read/write/create and tech group users will have read access.

Login as root with two different passwords [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is it possible to login via ssh on a linux machine, using one of two (or more) passwords set for root?
I want a primary password that I will change it frequently but in a case of emergency I want a "backup" password that will log me in. I hope that I stated the question clear. ;)
Don't use root accout. Use sudo.
When you configure sudo for your ordinary account, you can change root password to something complex and use sudo for normal daily work.
When something breaks, you will login to root with the complex password.
You can create multiple accounts that have userid 0, each with a different password. What matters for permissions is the userid, not the name.
However, there are some scripts that may check whether you're running as root, and they might check the login name rather than the ID. But if you're just using the backup account for emergency purposes, these glitches should not be a problem.
Disable the root login via ssh and create two user accounts, one for myself and a default account (which is there on all my machines with limited sudo access) with sudo access for both is what I do.
If it's all about ssh, then you can use keybased authentication, rather than password based auth.
This way, two (or more) users can login (as root, as a given user) without having to share the password.

How can I check the history of my centos VPS? Linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm about to hand out my root server password to a company for them to fix an issue that I have with mydns.
I'm sure they are all above board (and I will change the root password after they have finished) but I just want to be sure.
I know (well I think) I can login after them and execute history to see what they did, but I know if they are dishonest, they can just clear the history. I'm worried in case a rogue employee does something malicious or installs keylogging software (which has happened when my mate let another company manage his VPS).
So is there anything I can do? Does the history command backup somewhere? Can I install a keylogger to verify the commands they execute are not malicious?
Any ideas welcome. Ideally I appreciate I shouldn't give out my root password if I don't trust them. But I am in a very difficult situation and have no choice.
Since you are giving them root access, there is nothing you can do from within the machine that they could not subvert with a rootkit.
Your only way to be sure would be to mount the filesystem in another machine and compare the changes made to the files by comparing with a previously made snapshot/backup.

How to create a downloadable public link for files on server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am afraid my question could be very stupid, and also be duplicate. But I didn't manage to find what I want after looking for some similar questions on this site.
My question is simple, I have a big file, i.e. 1GB on my Ubuntu server, and I want to share this file with other users. How can I create a URL address for public users, in other words, when one user click this URL, the download will automatically start without demanding a username and password, just like we download many stuff (pdf, music) when we find an usable url with google.
Someone suggests me to setup an anonymous ftp. I think it's a possible solution, but I didn't succeed to accomplish it. Can some one give me more details how I achieve my goal, (with or without ftp will both ok).
Thanks for any help, and I am very grateful for some examples, or some tutorials !
Install Apache2
sudo apt-get install apache2
Place your into file the /var/www/ directory (might need root privileges for this)
sudo cp yourfile /var/www/yourfile
Access the file with the following link:
http://your-ip-address/yourfile
If your running under a router or firewall, you might have to open port 80 and forward it to your pc.
Lets assume your filename is foobar.iso.
You could just place it in your web root, and give the link example.com/foobar.iso to people. This will download the file.
Optionally, place it in a directory downloads. The download link will then be example.com/downloads/foobar.iso.

Resources