Hot answers tagged

15

In the image you show that the "other" group has read permissions; if you tried to append echo testline >> useradd or execute ./useradd it would give you a permission denied. If you're looking to remove read permissions for the 'other' users you can use sudo chmod o-r useradd


9

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

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


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


7

I believe it is because the permission on the useradd file is set to rw-r--r--, thus giving read access to all users.


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

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

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

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

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

Recent versions of Mac OS X have what's known as System Integrity Protection, aka "SIP", aka "Rootless". It basically makes parts of the file system read-only to everybody, including root. You may have bumped into that. https://en.wikipedia.org/wiki/System_Integrity_Protection The intent is to prevent mistakes and malware from modifying your base operating ...


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

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


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 $HOME/mytools/...


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

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

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

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

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


2

When creating the user with useradd use the option -s -s, --shell SHELL The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell specified by the SHELL variable in /etc/default/useradd, or an empty string by default. Give it the value /sbin/nologin. This will prevent ...


1

Much of what matters is what dependencies are required for xclip, and whether the libraries it needs are already on these system. Assuming a Debian or Ubuntu type system: You can go to repository that matches your friends machine, download the .deb file via a browser. then use dpkg-deb to extract the .deb into a temporary directory. find the executable ...


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



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