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

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


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


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


4

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


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

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

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


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

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


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

Symlink issue? I had a similar error message when using symbolic links. Apparently systemd doesn't follow symbolic links, the solution is simply to copy or move the file. User service? I believe that you need to add --user to the command line for units in user/: sudo systemctl --user enable arkos-redis.service


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/


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

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


1

sudo has problems, because it runs the command portion. After the redirect, sudo is not effective anymore. You can do this instead : sudo bash -c "Your commands here > output_file" carefully escaping the single or double quotes in the commands between quotes, in the nesting order you use them. EDIT: Explanation in a little deeper detail When you ...


1

I found a simple solution: add this normal user to the lpadmin group: sudo usermod -a -G lpadmin joe (FWIW< I had previously used visudo to give joe sudo rights to /usr/bin/kde-print-queue and I did not revoke that privilege.)


1

On my node: ll /proc/sys/kernel/core_pattern -rw-r--r-- 1 root root 0 Mar 1 21:32 /proc/sys/kernel/core_pattern It is only writable by root. Also chmod 666 /proc/sys/kernel/core_pattern chmod: changing permissions of `/proc/sys/kernel/core_pattern': Operation not permitted So I think you may not be able to override it.


1

Copy the postgresql unit file: cp /usr/lib/systemd/system/postgresql.service \ /etc/systemd/system/postgresql-userxy.service Then edit postgresql-userxy.service and add User= and WorkingDirectory= to the [Service] section. After that enable the service: systemctl daemon-reload systemctl enable postgresql-userxy.service


1

You need to add yourself to the wheel group: sudo usermod -a -G wheel $LOGNAME Then GUI would ask for your password, not the root's one.


1

All applications ran by normal user need extra permission to access /dev/* (that is owned by root, and other users need to be added to groups, like You said, to be able to manipulate files there according to group permissions) To answer Your question mkfs is utility for formatting from commandline, for example mkfs.exfat (with arguments) to allow users to ...



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