Hot answers tagged

7

Just add all needed commands to sudoers separately: %webteam cms051=/usr/bin/systemctl restart httpd.service %webteam cms051=/usr/bin/systemctl stop httpd.service %webteam cms051=/usr/bin/systemctl start httpd.service %webteam cms051=/usr/bin/systemctl status httpd.service


6

Figures that I'd figure this out on my own. The clue was here, in the user service output: Dec 23 19:43:27 redmine systemd[613]: Reached target Default. My unit was asking to be loaded with multi-user.target, but there is no such target in the user systemd. I changed this to default.target in the unit file, disabled and re-enabled the service, and it ...


4

Private mountspaces created with the unshare command can be used to provide a private /etc/hosts file to a shell process and any subsequent child processes started from that shell. # Start by creating your custom /etc/hosts file [user] cd ~ [user] cat >my_hosts <<EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ...


3

According to the locale(1) man page it can - you'll need to set the LOCPATH environment variable to point to the directory of your choosing (at least on some Linux systems). Note, that there are several sources of locale(1) man page - I have been able to locate at least two referring to Linux. I suppose you'll need to try to see whether this works on your ...


3

It's safest to itemize them as jofel suggests. If I wanted to allow someone to use a limited subset of a command's abilities, I would not trust wildcards in a sudoers line to do it. Even if the language was more expressive than shell globs, there are just too many corner cases to keep track of. The "service httpd *" line is relatively safe because (verify ...


3

The problem is not occurring because of the UID of the user. 500 is just fine as a UID, and that UID doesn't make it a 'non-login' user except in the eyes of the default settings of some few display managers. The error message No protocol specified sounds like an application-specific error message, and an unhelpful one at that, but I am going to guess that ...


3

you can try it installing nix using PRoot or you can build for your custom prefix NIX_STORE_DIR=/opt/custom/store \ NIX_STATE_DIR=/opt/custom/var/nix \ NIX_DB_DIR=/opt/custom/var/nix/db \ nix-build ...


3

TL;DR The working solution is using patchelf (if you have to deal with non-matching glibc versions: in the host system and the one nix libs have been linked with), see the second half of my story. Trying the usual approach Trying to use LD_LIBRARY_PATH Well, I have set up an environment variable for this in ~/.bash_profile: ...


2

You have to have someone have access to the root account to provide additional privileges. Beyond that, you can use sudo to limit effect areas of control for other administrators without giving them root. But overall, what you're describing seems to be more of a political / training issue than a technical issue. Hire the right staff, and they won't get in ...


2

Have you tried just using su? Most of the time the default user on a livecd has passwordless sudo, and can also su passwordlessly to any other user.


2

Some package managers support relocation. RPM in particular supports relocation, where the package itself has been built to support it. More information on rpm --relocate at rpm.org:Relocatable packages A comment by the maintainer of yum in 2008 (Seth Vidal) suggests that support for relocation within yum is unlikely. yum mailing list:Yum relocate option


2

If it's standard for /dev/rtc0 to belong to the audio group in Arch, you could just add yourself to the audio group (using adduser; you'll need to log out and log back in for the change to be effective). Alternatively, you could add an ACL giving yourself access to the device (look up setfacl to see how to do this). Ideally you shouldn't need to access the ...


2

Above and beyond the question of whether it's a good idea (it opens up the potential for a non-root user to fill up the root filesystem, causing havoc), you could accomplish this in several different ways: chmod a+w / -- to give "other" write permission chgrp somegroup /; chmod g+w /; usermod -G somegroup user -- to change the group ownership of / to a ...


2

It tends to get a little messy. You get folders like bin/, etc/, include, lib/ and source/ in your home folder. By choice, yes. If that seems untidy, you can use ./configure --prefix=$HOME/mytools Instead. You will then need to add that to your $PATH, or, if $HOME/bin is already part of it, you could move everything currently there into ...


2

You could use /var/tmp, but: If you have a quota, the admin will probably not appreciate you creating large files outside of your $HOME directory. Quite likely you even got a limit for /var/tmp. So that might just be an option for small files. However, if you are member of the fuse group (ask your admin to add you to the group if you're not), you can use ...


2

HOSTALIASES might meet your requirements. The question is related to: Can I create a user-specific hosts file to complement /etc/hosts? Here is a resource where HOSTALIASES is explained: http://blog.tremily.us/posts/HOSTALIASES/


1

Very likely you cannot make screen use the BSD pseudo terminals because it is compiled to use a specific style of pseudo terminal (never both). There are two main flavors with variations: a function (such as openpty) provides the names for the master and slave devices the program searches through a list of master/slave pairs for an unused pair In the ...


1

Yes, you can give your user the right to run sudo du /var with no password, I'll show you how later. However, do you really want this? There are very few files and subdirectories that du needs root access to. The difference is reported size between sudo du /var and du /var is tiny (at least on my system): $ sudo du -s /var/ 1830596 /var/ $ du -s /var/ ...


1

In most cases as an admin I set aside /usr/local for my users to use for files that they for whatever reason don't want to, or cant use their $HOME directory for it. At the end of the day though: This sounds like a job for a conversation between you and your sysadmin Realistically it is probably intended that you work within the confines of $HOME quota's ...


1

I found a solution that works. To iterate my steps: 1) Download relevant RPM (or here) 2) Copy to Linux server and upack using (replace filename as necessary) rpm2cpio git-1.7.9.6-1.el6.rfx.x86_64.rpm | cpio -idmv 3) Update $PATH: PATH=$PATH:<your path to git>/usr/bin 4) Now see it work git --version


1

Well, to be sure, you'll need to run that script with escalated permissions. Imagine that someone has an suid program inside the following directory: $ ls -ld sneaky d--x------. 2 user111 g1 4096 May 26 17:19 sneaky $ ./sneaky/test.sh runs Your script will not be able to find that file, even if your program runs as user user111.


1

There are two types of filesystem drivers: kernel or userland. Kernel filesystem drivers are the classical type. They are faster, but since they run kernel code, it is hard to control what they do. For this reason, by default only the system administrator (the root user) can mount a filesystem using a kernel filesystem driver. The administrator can ...


1

Depending on what files you want, you can create a new group (/etc/group) and make the file writable (and the directory containing it if you want the user to create new files) by that group (e.g., chgrp <groupname> <file>; chmod g+w <file>


1

You have to use commands su or sudo. Just adding user to group wheel or adding in sudoers is not enough. The su command switches to the root user – when you execute it with no additional options. You will have to enter the root account’s password. This isn’t all the su command does. You can use it to switch to any user account. If you execute the su john, ...


1

What is your distribution? Does your distribution have rtmpdump available as a binary package? Debian does, for example, and therefore Ubuntu and Mint should as well, for example. If so, why aren't you using it? In any case, apt-file search librtmp.so librtmp-dev: /usr/lib/x86_64-linux-gnu/librtmp.so librtmp0: /usr/lib/x86_64-linux-gnu/librtmp.so.0 ...


1

The simple fact is that if a person can arbitrarily install programs then they probably can install a program that will run under root privileges, so they could install programs that would grant them other types of access. IE any person who can install or modify something that is run as root, is or can easily become root. If you want to separate out your ...


1

sudo has ways to give users access to some, but not all, commands through sudo. You can use the visudo command to safely edit the /etc/sudoers file, with some syntax checking before the file is really saved. Inside the file, you can add a line like mike ALL=(root) /usr/bin/aptitude, /usr/bin/apt-get to give mike access to aptitude and apt-get through sudo, ...


1

Not exactly a pretty solution, but shouldn't it work when you run commands that require root privileges with sudo inside the script and add a nopasswd rule for them?


1

According to this discussion CAP_SYS_RAWIO capability needs to be applied to smartctl executable.


1

It fails, because sudo is trying to prompt on root password and there is no pseudo-tty allocated. You've to either log-in as root or set-up the following rules in your /etc/sudoers (or: sudo visudo): # Members of the admin group may gain root privileges. %admin ALL=(ALL) NOPASSWD:ALL Then make sure that your Jenkins user belongs to admin group (or ...



Only top voted, non community-wiki answers of a minimum length are eligible