Tag Info

Hot answers tagged

9

you can install it locally in your home directory. Ususally it can be done by specifying the parameter prefix for configure script. For example, ./configure --prefix=$HOME So, when you compile sources configured in such way, then you will call ** make install** the binaries will install into you $HOME/bin Also, you should alternate PATH variable. You ...


5

It's likely that the list of users come from a network service: probably LDAP, maybe NIS if the network has been around for a very long time; the home directories are automounted, i.e. mounted from some file server when the user logs in. The file /etc/nsswitch.conf defines what sources provide user lists (the passwd setting). The Solaris commands ...


5

Use the --prefix option with the configure command. I won't try to give a complete configure command here, since GCC is one of those programs most often given complex configuration options, but adding something like --prefix=$HOME/my-gcc-4.7 will work. Upon installation, you will get a tree under that directory containing things like bin/gcc. Once it's ...


5

I was looking for a way to run a program with modified DNS resolution for testing purposes. For me, the solution was using the HOSTALIASES environment variable: $ echo "foo www.google.com" > ~/my_hosts $ HOSTALIASES=~/my_hosts wget foo See hostname(7).


5

Install and use sudo. It's the one and most sane way of doing these things. dhclient really needs root privileges, there's no way around it. Allow specific users to execute a single command with root privileges. This can be configured in a /etc/sudoers file like this (edit using visudo): Cmnd_Alias DHCP = /usr/sbin/dhclient User_Alias DCHPUSERS = ...


4

A user's BASH environment variables can be defined in ~/.profile. Add a line to this file: export PATH=$PATH:~/bin To read the new PATH variable now: . ~/.profile or source ~/.profile (The . and source are synonyms.) Then to see that the PATH variable was updated: echo $PATH Update I have never seen {} in a PATH environment variable? ...


4

On Debian and derivates, you should probably use update-java-alternatives. Anyway, all those tools are system related, not user related. If you want to use a different java, simply put those lines in your ~/.profile: JAVA_HOME=/usr/lib/jvm/java-6-sun JRE_HOME=/usr/lib/jvm/java-6-sun/jre PATH=$JAVA_HOME/bin:"$PATH" export JAVA_HOME JRE_HOME


4

Compile and install into ~/bin (and edit your .bashrc to set the PATH to include it). libraries can similarly be compiled and installed into ~/lib (set LD_LIBRARY_PATH to point to it), and development headers can be installed into e.g. ~/includes. Depending on the specific details of the programs you want to install and the libraries they depend upon, you ...


4

Beside the LD_PRELOAD tricks. A simple alternative that may work on a few systems would be to binary-edit a copy of the system library that handles hostname resolution to replace /etc/hosts with a path of your own. For instance, on Linux: If you're not using nscd, copy libnss_files.so to some location of your own like: mkdir -p -- ~/lib && cp ...


4

You could (or do?) probably use wpa_supplicant; using its ctrl_interface configuration key, you can allow non-root users (e.g. those with group wheel) access via wpa_cli (i.e. /sbin/wpa_cli scan_results [1]) # allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel There's also a ...


4

The permissions of the script are irrelevant. Setuid and setgid bits are ignored on scripts on Linux and most other unices. You can configure sudo to allow you to run this script without specifying a password, with the NOPASSWD tag. Make sure that sudo doesn't require to be connected to a terminal: turn off the requiretty option. Note that the ...


4

The solution must probably be based either on ptrace or namespaces (unshare). ptrace-based solutions are probably less efficient then namespaces/unshare-based (but the latter technology is cutting-edge and is not well explored path, probably). ptrace-based UMView As for ptrced-based solutions, thanks to the comments at ...


4

There are ways to install rpms in a user directory using rpm, but I don't believe it is straight-forward. I don't believe there is a way with yum. My standard practice has become to compile from source to a local directory in my home $ mkdir ~/local $ mkdir ~/local/bin $ mkdir ~/local/lib $ mkdir ~/local/include I download source as I would to ...


3

Not having root privileges prevents you from listening on ports below 1024 on typical Linux systems. Thus, Squid should work OK as non-root listening on 8080 as long as the system you are on hasn't blocked incoming traffic on that port via a firewall or iptables. Not sure how many file descriptors Squid uses typically but if your admin has set a limit for ...


3

Yes, security is the reason and no, su has no way of circumventing that. But there is sudo, which can be used for what you want and it has a configuration file where you can disable the need to enter a password. It also allows for complex configurations so that you can disable the need for a password for a very specific command only, to not fully void ...


3

You can't write to /var/log as a normal user, but the syslog daemon will do it for you if you ask. If you'd like to log messages to the standard system logs (e.g. /var/log/syslog), the 4.4BSD utility logger might be available on your system. It's installed by default on Debian, and is in the bsdutils package on Debian derivatives. You'll get the advantage ...


3

If you as an ordinary user decide to run a program, the natural place for its logs are in your home directory. Your home directory is meant for you to store all your files, whether they are logs of a program you run or anything else. If the program is executed as part of the system, running as a typically dedicated system user, then the natural place for ...


2

You can communicate with ConsoleKit through dbus. For example using the dbus-send tool a few notable commands are, Shutdown: dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop Reboot: dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" ...


2

This is how the system is designed. Since the filesystem is being mounted by root and it's not listed in /etc/fstab with the user option, only root can unmount it. You can't change this behavior. What you can do is to modify your script to mount it in a location you own as your user. You'll also need to make the block device readable/writable by you. That ...


2

“Error mounting location: volume doesn't implement mount” apparently translates to “I need D-Bus but it isn't available”. (Thanks to venturax's guru colleague for this information.) Within an SSH session, I can use gvfs-mount provided that dbus-daemon is launched first and the environment variable DBUS_SESSION_BUS_ADDRESS is set. export $(dbus-launch) ...


2

GoboLinux in rootless mode is a linux distribution installable in your home without needing root privileges. To install GoboLinux in rootless mode you will need at least the following tools installed on your system: GNU Bash GNU CoreUtils GNU Sed GNU Wget


2

Not if you don't care about where it is installed. Using prebuilt binaries will work fine if they are statically linked or you have all the appropriate libraries (of the requested versions) already on the system. RPMs in general are not statically linked, but they do contain the dependency information, so you could check if you have all the prerequisites ...


2

If you're fine with compiling from source and resolving dependencies yourself, primarily wanting the package manager to handle deploy/undeploy/upgrade operations, you might want to take a look at GNU Stow or the somewhat improved XStow. With them, you stage the installation to a separate directory (typically under $PREFIX/stow) and then stow makes symlinks ...


2

First off, that you want to do a su to yourself is really weird. It makes me worry that you've misunderstood something fundamental, as I'm having a hard time coming up with a reason why you'd ever need to do this. Second, su's password prompting is actually controlled by PAM (as is most password prompting) if your system uses PAM. Certainly, all major Linux ...


2

You have sudo added to your tags. In your sudoers file, you can add dev to allowed users and, if you wish, restrict which commands they're allowed to run, and that password isn't required. Then all they'd have to do is type "sudo su - tomcat". Run visudo to add the following line: dev ALL = NOPASSWD: /usr/bin/su - tomcat There's lots more information and ...


2

You've created a user with a “disabled password”, meaning that there is no password that will let you log in as this used. This is different from creating a user that anyone can log in as without supplying a password, which is achieved by specifying an empty password and is very rarely useful. In order to execute commands as such “system” users who don't ...


2

You can do it like this : trap ' if [[ $BASH_COMMAND =~ /sbin ]] && ((UID!=0)); then echo >&2 "${BASH_COMMAND##*/sbin/} must be run as root" fi ' DEBUG But ifconfig is accessible for users too, just need to type /sbin/ifconfig. Like Chris Down said, I have never seen ifconfig issuing such a prompt message in its default ...


2

Generally for a daemon the log file is created by root then the permissions are altered so that the non-privileged user can write to it. logrotate is then set up to preserve permissions during rotation. If it's a command, not a daemon, then log to /tmp (preferably using mktemp) and inform the user via STDOUT where the log went.


2

As long as you don't have root, you can't test all of the memory. There are several programs out there for testing the memory, but I suspect most or all of them require root access. What you could try is to generate a large file with random data, the size of your ramdisk, run a checksum like sha1, copy it over and then compare the checksum. Repeat this ...


2

On modern Unices, only the file owner is allowed to change the file mode. There were some historic Unices that had a feature called "group superuser", but this no longer exists in any modern Unix that I know of. The only way to do this would be to have a setuid program that checks your group memberships, and allows you to chmod if you match the file's ...



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