How to disable hard link to /etc/passwd [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 learning security recently, and noticed that on my experiment system I can create a hard link to /etc/passwd in my home directory, while on my work system I cannot:
$ ln /etc/passwd
ln: failed to create hard link ./passwd' =>/etc/passwd': Operation not permitted
What is done to disable this?

This is because you are trying to create hardlink to /etc/passwd on a different volume. Most likely at your home system you setup everything onto a single volume.

Related

Limited permissions on 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 want to give a specific user on Linux some privileges to enable him to run commands like shutdown or apt-get. I don't want to use the SUID bit since there are other users that I don't want to let them use these commands.
How do I do something like this?
sudo would probably be the easiest way to do this. You'll want to add something like the following to the sudoers file
username ALL=(ALL) /sbin/shutdown, /usr/bin/apt-get
where username is replaced with the user's actual username. You should be able to google for some examples - here is one such page.
Editing the sudoers file can be done safely by using the visudo program.

On Linux get disk space used per user when you are not root [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
du --max-depth=1 will give the usage of the user you are logged in as. But we have a dev box shared by more than one team, so its getting tough to find the culprit.
If I am root I can do it but I am not the root user and dont want to ask the System Admins all the time to find the user with most usage.
Any ideas on this please.
You can't determine the size of directories you have no read/execute permissions for, so this is only possible when being root.

Unauthorised Perl Scripts [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
One of my servers just had the memory exhausted by a load of Perl scripts, we use plesk and they seem to have appeared under the /var/www/vhosts/domainexample.com/cgi-bin/ directory, I managed to stop all of the processes and delete the scripts but I have absolutely no idea how they would've got there.
Can someone point me in the right direction in order to prevent further attacks?
Who should have access to your webserver machine?
Does this include the owner/operator of domainexample.com?
Do you expect the owner to be placing cgis on your server?
Does domainexample.com need to run cgis?
does domainexample.com need to run perl?
You might want to start researching here:
http://httpd.apache.org/docs/current/misc/security_tips.html

Sign script in Linux for SSH access [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 want grant user rights to copy a specific file from a remote server via SSH. And I do not want to give him any opportunity to execute something else on a remote server.
I have an access to a remote machine but I'm not an adimistrator, and I want to give another user possibility to copy specific file but nothing else.
Is there any way to sign a script in linux to avoid modification of this script or something similar that could help?
There is a solution to restrict SSH run only specific command:
http://chihungchan.blogspot.com/2008/08/restrict-ssh-to-run-specific-command.html

Is it possible to clean a Linux VPS using the shell? [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 11 years ago.
Improve this question
Sometimes my friend give me root access to his CentOS VPS to help him install some programs and he leaves. Sometimes I mess with it, but I don't have the login information for Parallels Virtuozzo Containers, so can I clean the VPS using SSH?
It's faster than formatting the VPS and re-installing the OS.
You could always take a backup before you being work and revert the changes after the face. rsync is one potential tool you could use to do this.

Resources