Hot answers tagged

8

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


8

Because sudo cmd > file is interpreted as (sudo cmd) > file by your shell. I.e. the redirect is done as your own user. The way I get around that is using cmd | sudo tee file Addition: That will also show the output of cmd on your console, if you don't want that you'll have to redirect it.


7

Yes. The normal/unprivileged user can write to /tmp and /var/tmp, for legitimate reasons. Also, if the user or group permissions of a given file/directory includes those of the user, he or she can write to those files or directories as well. Having said that, providing write capability to operating system files and directories to a normal user, is shooting ...


6

Use systemd's coredumpctl to list and retrieve your core dumps. Use the PID or name of the program to select one to dump (to file -o ...) or to run gdb on. $ coredumpctl list TIME PID UID GID SIG PRESENT EXE Mon 2016-04-11 11:18:23 CEST 21538 1000 1000 11 * /usr/bin/sleep $ coredumpctl info 21538 PID: 21538 ...


6

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


5

/tmp and possibly /var/tmp are writtable to any users.


5

Other answers show how to download and compile dos2unix, but if you're simply looking to convert files from DOS-style line endings (CR-LF) to Unix-style line endings, there are several other approaches which shouldn't involve installing anything: if you have tr: tr -d '\r' < input > output if you have Perl: perl -pi -e 's/\r\n/\n/g' input (which ...


4

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

You don't need root access to change your own shell to any shell listed in /etc/shells. Just run chsh -s /bin/bash. A normal user can only change their own shell. And only to one of the shells listed in /etc/shells. Root can change any user's shell to anything at all. see man chsh for details. NOTE: root may disable this if they choose, e.g. by ...


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

bash-completion is enabled by sourcing a shell script—it sits at /usr/share/bash-completion/bash_completion on my Debian box, for example—but you can put it wherever. It looks in its own directory for the completions to load. Completions used to go in /etc/bash_completion.d, but that's now a backwards compatibility directory and can be changed by setting ...


3

If you have the "suid" version of busybox, you could try to make the date command execute as root like this: File /etc/busybox.conf: ... [SUID] date = ssx root.root ...


2

First of all, you downloaded a dos2unix executable for windows (dos2unix-7.3.3-win32.zip), which is not what you want because you are using Linux. Try downloading the source code for dos2unix for Linux and extract it to your home dir: mkdir $HOME/bin/ tar -zxvf dos2unix-7.3.3-src.tar.gz # the exact name of the downloaded file may vary cd dos2unix-7.3.3 ...


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/


2

As far as I know, > is the command by shell itself (redirection is done by the non-root shell itself) When you use su, it runs as a root shell which allows you to redirect for root-owned files


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

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

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

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

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.


1

Vesa K's version of Ryan Novosielski's answer works for me, but the lines are in: /etc/pam.d/sshd not: /etc/pam.d/login In my case, I just want UID 1000 under Ubuntu 14.04 LTS to be allowed to login via SSH. # Disallow non-root logins when /etc/nologin exists. account [success=1 default=ignore] pam_succeed_if.so quiet uid eq 1000 account required ...


1

Here is the wiki for configuring polkit rules for udisks/udisks2 in order to mount partitions by non-root (e.g. users) group. Save the code below to /etc/polkit-1/rules.d/50-udisks.rules polkit.addRule(function(action, subject) { var YES = polkit.Result.YES; var permission = { // only required for udisks1: ...


1

1 Look where it works On Xubuntu it works out of the box to mount and eject USB mass storage, hard disk partitions, CD/DVDs and probably more. Let's assume that the solution Ubuntu chose, using policyKit, is secure enough. 2 Pick the relevant part On XFCE on Debian 8.3 I needed to allow user to mount and eject filesystems from thunar without password. ...


1

Create a command alias with the commands you want them to have access to. Then assign the group to that command alias: Cmnd_Alias APACHE-SVC = /usr/bin/systemctl stop httpd, /usr/bin/systemctl start httpd, /usr/bin/systemctl restart httpd %webteam ALL=APACHE-SVC It is also good practice to place any edits in your /etc/sudoers.d/filename rather than ...


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

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

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

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



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