Tag Info

Hot answers tagged

9

The easiest way to do this is to install R from source: $ wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz $ tar xvf R-3.1.1.tar.gz $ cd R-3.1.1 $ ./configure --prefix=$HOME/R $ make && make install The second-to-last step is the critical one. It configures R to be installed into a subdirectory of your own home directory. To run it on ...


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 ...


5

The --disabled-password option will not set a password, meaning no password is legal, but login is still possible (for example with SSH RSA keys). To create an user without a password, use passwd -d $username after the user is created to make the password empty. Note not all systems allow users with empty password to log in.


4

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 ...


4

You can also use the wrapper application Renv. excerpt Simple R Version Management: Renv Renv lets you easily switch between multiple versions of R. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. Renv does… Let you change the global R version on a per-user basis. Provide ...


4

When a user invokes sudo -l it lists what sudo will allow them to do, so you could have a script ran as root that bumps through /etc/passwd and sudo's to each user, invoke the sudo -l, directing the output to /tmp/${USER}_sudo_i_can_do.txt But if you don't have root access, you won't be able to do what you want to do; the list of permissions is readable ...


4

This is a known problem, if you ssh as root somewhere and then su to become a normal user: $ ssh root@server # su -l anthon $ screen Cannot open your terminal '/dev/pts/3' - please check. It is e.g. described in these posts from 2005 The solution is to directly login as the user you want the screen session to run as.


4

Install your favorite shell on the remote machine. You don't need any administrator privileges to do that, you can install programs in your home directory, it's just less convenient. See Installation on debian 5 32-bit without being a root, How to install program locally without sudo privileges?, Keeping track of programs and other questions. If you want to ...


3

I believe you can use pmount instead. It's in the Debian 7.7 repos. $ apt-cache search pmount libpmount-dev - portable mount library - development files libpmount0.0 - portable mount library - shared library pmount - mount removable devices as normal user Usage $ pmount -h Usage: pmount [options] <device> [<label>] Mount <device> ...


3

There are two options, comment out the Defaults requiretty setting from /etc/sudoers as you mentioned or use the pseudo-tty allocation (-t) argument for ssh. Try the following in your jenkins script: ssh -t 127.0.0.1 "sudo command" Although you will have to have ssh pre-shared keys configured to yourself and run it once manually to add an entry to ...


3

Simple answer: No, you cannot use on a remote box a program that is not installed on the remote box. Workaround: You do not need admin privileges to install a shell on the remote system. You can install it in your home directory but probably you have to compile it from the sources. Typically using something like configure --prefix=${HOME}/local Last note: ...


3

If you need to do something that requires root privileges, you need to use some method of gaining root privileges, which on most modern systems means su, sudo, or a wrapper around one of these. What's dangerous about running commands as root (whether it's with su or sudo) is that it gives you a lot more ways to damage your system. So you should only run a ...


3

This is what worked for me: USER_NAME=$(printf '%s' "${SUDO_USER:-$USER}") sudo -u $USER_NAME <command-to-exec-in-nonroot-context>


3

nothing is guaranteed. root - is usually on linux/unix systems, but - i saw systems where uid=0 was used by "admin". Usually - there are users like root, nobody, daemon, bin, sys. www-data is on debian/ubuntu, but for example on redhat/centos/fedora/pld there is apache user instead. Recomendations/fixed uids for users other than root are only within ...


3

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


2

I'm not certain why @mtneagle got down-voted. The three items the OP wanted are: The platform type (dmidecode -s system-product-name) The BIOS version (dmidecode -s bios-version) The amount of physical memory (dmidecode -t17 | grep Size) We can get each of these thusly: dmesg | grep "DMI:" | cut -c "6-" | cut -d "," -f "1" dmesg | grep "DMI:" | cut -c ...


2

I use JuJu which basically allows to have a really tiny linux distribution (containing just the package manager) inside your $HOME/.juju directory. It allows to have your custom system inside the home directory accessible via proot and, therefore, you can install any packages without root privileges. It will run properly to all the major linux ...


2

Since you're using cpio, you're actually making an initramfs, not an initrd. An initrd would be stored as a filesystem image, not as a cpio archive. Initrd and initramfs have similar roles in the Linux boot process, to provide some files that are available before the true root filesystem (and that are used to mount the true root filesystem); they are handled ...


2

Those errors are there because your user has not the permission to create nodes. Only root can create nodes other than fifos and sockets (see mknod documentation under EPERM) When you repack again the initrd, those special file wouldn't be in there. To repack the initrd there is an option called --owner that can be used to set the owner for all files. BUT, ...


2

The basic approach is to copy the shell executable to the remote host using scp then execute it using ssh, e.g. scp /usr/bin/fish remote:fish && ssh -t remote '~/fish' The -t is needed so that ssh allocates a tty, which it wouldn't do by default when executing a remote command. This assumes your remote host is running the same operating system. ...


2

User can use sshfs to mount his remote $HOME on his local machine. In such scenario, user wouldn't use his shell of choice on the remote machine directly but, still, better than nothing.


2

What you're using isn't KVM directly, but a management library called libvirt. You can specify a user which will have access to libvirt's setup (and thus creating VMs and pretty much running virsh commands) by adding the users to the libvirtd and kvm groups on the host. You can also use policykit to manage access, the procedure is described in the libvirt ...


2

The solution I found was to run the following: sudo sed -i \ 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config Note, that in your situation, the console may be root or another, based on your particular initial configuration*


2

The obvious answer, "install the command on the remote machine", is the most clean solution, so we should not ignore it: If this is possible to install the command as root, for example with sudo apt-get install fish, the command can be run like this: ssh remote -t fish The question is about what to do when we can not install a command on the remote ...


2

The only thing that comes close is iostat from the sysstat suite which also works for regular users or maybe atop -d (fails with a floating pointing exception here). Nearly same question was already asked here: http://serverfault.com/questions/260818/in-absense-of-iotop-which-command-is-most-appropriate-for-get-i-o-bounded-proces iotop doesn't work for ...


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

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 ...


2

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 ...


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 ...


1

You can use - if you can get the initial right to do so granted to you - the linux kernel's User namespaces. In a user namespace a user can be apportioned a piece of a disk and run a full-fledged container within as a super-user without otherwise affecting the parent environment. You will need a 3.8 or later kernel, some linux-savvy, and the initial setup ...



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