Tag Info

New answers tagged

0

Maybe you are using vi to try to start VIM which will not use /etc/vimrc. If that is the case, you have two options: Use vim Modify /etc/profile.d/vim.sh to set vi as an alias for all users not only for users with a uid >= 100


3

There are a few ways to output the user ID (UID) with ps; a simple one is with -f: ps -fC X Will give you information for all the X servers that are running (there can be more than one). This presumes that the executable is called X -- if there's no such process, you will have to target something else. Since it almost certainly at least has capital X in ...


1

This also works well: :w !sudo sh -c "cat > %" This is inspired by the comment of @Nathan Long in this answer. NOTICE: " must be used instead of ' because we want % to be expanded before passing to shell.


0

Just use su or even sudo to do so. For example: su - nobody -c command Use find. see http://unix.stackexchange.com/a/38691/29241 for details.


0

You can use sudo to run a command as an arbitrary user: sudo -u [user] [command], thus limiting the privileges to said user.


1

You can change it when using php mail() function, by passing an additional parameter: <?php mail('receiver@address.com', 'Subject', 'Message', null, '-fnoreply@yourdomain.com'); ?> Or make it default by changing sendmail_path option in php.ini: sendmail_path = /usr/sbin/sendmail -t -i -f'noreply@yourdomain.com'


1

Your new user new_username will not have root privileges after editing the sudoers file. This change only allows new_username to run sudo in order to run a task with superuser privileges: $touch testfile $chown new_username testfile chown: changing ownership of 'testfile': Operation not permitted $sudo chown new_username testfile [sudo] password for ...


0

You can always disable a root account by setting his login prompt to nologin in /etc/passwd file. However, after setting this, you would not be able to use root account even using ssh or su. root:x:0:0:root:/root:/sbin/nologin Now, as per this link, after setting sudo privileges to an user, the user must log off and log in back again for the effects to ...


0

There is a utility called sshpass which allows you to supply a password as an option on the command line. This tool can be scripted so that it runs on multiple hosts, even in parallel. Install sshpass on your jumpbox, then take something like this: sshpass -p password ssh root@host 'hostname;date;id' and embed it in a shell loop or other method (such as ...


0

Thanks for the answers. I ended up solving the issue by changing the the folder owner to myself, using chown. This resulted in me not having to use sudo everytime I wanted to create/edit a file.


1

You need to run vim as root. sudo vim /var/www/file


2

Sorry I am not able to comment yet. Try to run command :sudo -s by this you will login as root. Then, I guess, you can do whatever work you want to.


3

Without the ability to use sudo your options become limited to essentially 2. Method #1 You can either put the users into the same Unix group (/etc/group) so that they're able to access the same files & directories. Example $ more /etc/group somegroup:x:1001:adminuser,nobody You then need to set the parent directory that contains this file like ...


6

Yes, it's normal. The root user can do anything (including, say, changing a user's password, logging in as them, and changing it back), so they aren't restricted by su (or sudo). That includes password prompts and any other restrictions. The PAM configuration can be set up to have su present certain prompts to the root user still, for example encryption ...


1

Go to Keyboard window and in the Custom Shortcut part the command is: gksu gnome-terminal


0

Your question has way too much unnecessary information, but I'll answer anyway. Your best option is to open the menu in your menu editor(depends on what desktop enviroment you're using as to how you do it), when in the menu editor just mark the "Root Terminal" entry and figure out which command is used and then set that to your keyboard combo.


8

The sudoers file allows specifying commands to permit: username ALL=(root) NOPASSWD: /bin/foo bar baz Here username is the user you want to permit, and the command goes at the end of the line. If you specify arguments to the command, the user can only run it with exactly those arguments, but if you don't specify them here, the user can run the command ...


0

You can increase security by restricting the commands that a "sudo user" can run. This is highly recommended. This is the syntax on a Debian box I have, might be slightly different depending on the system. Cmnd_Alias USER_COMMAND = /bin/user_admin someuser ALL = PASSWD : USER_COMMAND This way someuser can only run the command /bin/user_admin as ...


1

As the other answerers said, this is the default behavior. If you really want to enter the root password instead of the user's password, you can add the line Defaults rootpw to your /etc/sudoers file (use the visudo command, do not edit the sudoers file by any other means). The usual disclaimer: The defaults chosen for sudo are the way they are for a ...


3

That's how sudo works. You trust the user and the user's actions are logged. If you want to enter the root password, then you want to use the su command as follows:- su -c yum install <package> Password: Once the command above finishes, you're returned to your normal user's prompt.


1

Well it is how it's done. You will grant the permission to users of group wheel to perform administration duties. In short you grant them root access. And this is not distro specific - in all Linux distributions and even BSDs you will do the same. If you're worried about compromising security you could remove the user from sudoers table and go with root. ...


0

Running su - erases almost all environment variables. GUI applications need two environment variables to know how to connect to the GUI environment: DISPLAY and XAUTHORITY. See Open a window on a remote X display (why "Cannot open display")? for a more detailed explanation. The command su - retains DISPLAY but not XAUTHORITY. So your GUI ...


0

Though this command may be safe in most cases, it is a bad habit to use * where the command can accept options, because a filename starting with a dash (created by mistake or by a malicious person who could have exploited another bug) could be interpreted as an option. As someone said, the * is pointless here, but what you need to remember is that, ...


1

Confirm that you've created a full restore disk. It could be simply a repair/boot disk. I recently created restore disks from my laptop (and I know they works as I've used them) and they came to 3 DVDs. With a Windows full restore disk set you'll completely overwrite the HDD (wiping your Arch install), reinstating your Windows and OEM partitions. That ...


2

The /home partition is useful if, for example, at one point you want to reinstall Arch or install another distribution, because thus you will save your personal settings, browser history, etc.


-1

find will print all files and folders in the directory tree. xargs runs the command supplied - rmdir for each element find returns. rmdir will not remove folders that aren't empty, and will not remove files either - you can try it. mkdir a folder, touch a few files inside it and then run rmdir on the folder. rmdir will complain with something like this: ...


5

The man page for rmdir says:- Remove the DIRECTORY(ies), if they are empty. If you want to remove all empty directories then it will be safe. The question you need to ask is:- Do you want to remove all empty directories? Some applications need a directory even if it's empty. For example, journald can be configured so that it only logs to persistent ...


4

As man su notes, /etc/pam.d/su is the default PAM configuration file for su. One of the options is to grant implicit elevated privileges for anyone in the wheel group: # Uncomment the following line to implicitly trust users in the "wheel" group. auth sufficient pam_wheel.so trust use_uid With this line uncommented, when you issue su without any ...


1

It is really unclear with your question's current state. I believe you have to export the display. export DISPLAY='IP:0.0' See the answer here. Check the server's sshd_config (normally /etc/ssh/sshd_config), and make sure the X11Forwarding option is enabled with the line X11Forwarding yes If X11Forwarding is not specified, the default is no.



Top 50 recent answers are included