Tag Info

New answers tagged

0

That's really strange, you should be able to kill the process regardless of the user root or any other user and the fact that it gets owned by root. I understand it's hard that it's hard to even begin to solve it since it's not a common issue. Have you done any updates? My main question is when you kill the process are you doing sudo kill -KILL PID? ...


0

You have to boot in Recovery Mode before using Paul D. Waite's suggestion: Right after booting your Debian system choose "boot in Recovery Mode" Right after booting into "Recovery Mode" right at the command prompt simply type: sudo password root then the system will ask for the new Root's password once and twice to verify and you ARE done.


2

I created a new file named new which is now owned by the root user as seen below. ls -lat new -rw-r--r-- 1 root root 42 Sep 9 13:37 new Now, I logged in as a normal user and from there I tried to erase the contents of this file using the below command. sudo sh -c " > /root/new" Now, I can verify that the contents are erased by logging back as root ...


0

Here's yet another alternative - just in case you were looking for one... sudo cp /dev/null /path/to/soon/to/be/truncated/file


3

To empty a file as root, you can also use the truncate command: $ sudo truncate -s0 file.txt The -s0 sets the file's size to 0, effectively emptying it.


2

It's difficult and confusing to get sudo and redirection together to work, but there is a more clear alternative: printf '' | sudo tee file.txt There is nothing special, actually: tee truncates the output files by default without -a option. It writes the input from stdin to the file. The input is the empty string, so the file is left empty. tee ...


2

sudo wants to run a program for you, but > file.txt does not contain a command. It is simply an implicit output redirect (incidentally, this doesn't work as given under tcsh, zsh and probably others). Even if you pass sudo a valid command, such as echo or : (the built in null command), what you are trying to do won't work as you expect. When you hit ...


3

sudo > different-file.txt launches sudo without arguments, and redirects standard output into different-file.txt. (Sudo probably outputs nothing to stdout when no arguments are given, so if you had permissions to overwrite you would probably truncate the file if it existed). Try cat /dev/null > different-file.txt instead (from a root prompt). Become ...


5

Use sudo -i to become root (with a root-shell) first instead. sudo is used to run commands as root, but > isn't a command, but a redirection inside the shell - neither of which is run by root. Say you run sudo cat foo > bar... cat is run as root, and can access and do anything - including opening "foo" even if it was owned by another user than you ...


1

I understand that you want the system to write an email to root, do it like this: echo "Test" | mail -s "Test " root Q: And furthermore on which events does Linux send root mails at all? That depends entirely on your configuration.


0

with proper key settongs, assuming you can set thoses keys in myserver's app home dir. scp file.txt app@myserver:/etc/app/config/file.txt Step 1) in local host, check in $HOME/.ssh for any file name id_rsa.pub, if found goto step 3. Step 2) If not found, in local host (starting host) cd $HOME mkdir .ssh chmod go-rwx .ssh cd .ssh ssh-keygen accept ...


2

If you have cooperating users, you can setup rootsh to log everything the root user types to syslog. http://linux.die.net/man/1/rootsh rootsh rpms are available in EPEL. The version of sudo on RHEL6 is also capable of logging stdout to a file for every sudo session. Look into the sudo_plugins man page. Neither of these approaches is completely ...


2

On Red Hat distros you typically use the /var/log/secure log to identify who's been logging in or making use of sudo on a Fedora/CentOS/RHEL system. Examples sudo example $ sudo -Es log result: Sep 1 19:32:51 greeneggs sudo: saml : TTY=pts/2 ; PWD=/home/saml ; USER=root ; COMMAND=/bin/bash su example $ su - log result: Sep 1 19:34:49 ...


0

From the brief description you have provided it seems it would be better if you set up a log monitoring system. It would help you monitor the logins, create alerts, compare the data of several days, and yes of-course Graphs for all that. But if you need to monitor it temporarily, you can use last command. last | grep root | grep -v tty | awk '{print $3}' ...


0

You're probably looking for the -E option of sudo which causes it to keep your user's environment variables: -E, --preserve-env Indicates to the security policy that the user wishes to pre‐ serve their existing environment variables. The security policy may return an error if the user does not have permis‐ ...



Top 50 recent answers are included