I have (normal user) access to a SunOS 5.10 machine.  /usr/bin/which is broken (it blocks).  Clearly something is wrong on the system, but not having root access limits drastically what I can do. I have tried copying my which from Ubuntu, but that depends on features not available on SunOS 5.10.  $ md5sum /usr/bin/which a39bb82e9e354c5b99e9e235a53c48d9  /usr/bin/which $ uname -a SunOS solaris 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Fire-V210 Solaris $ bash --version GNU bash, version 4.3.33(1)-release (sparc-sun-solaris2.10) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;  This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.   Where can I find a which command that will work on this old system?
1248
When looking for the path to an executable or checking what would happen if you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, whereis, whatis, hash, etc).  We often hear that which should be avoided. Why? What should we use instead?
56087
I wanted to try out rsh (or rshell?) - the old, insecure way of logging in remotely.   On my Ubuntu 11.04, it turns out an rsh command exists:  $ which rsh /usr/bin/rsh   ... however, it turns out it is a mere symlink for ssh:  $ ls -la `which rsh` lrwxrwxrwx 1 root root 21 2011-03-25 16:07 /usr/bin/rsh -&gt; /etc/alternatives/rsh  $ ls -la $(readlink -f `which rsh`) -rwxr-xr-x 1 root root 391580 2011-04-02 12:16 /usr/bin/ssh   Does this "old" rsh exist in Ubuntu repositories - and if so, how do I install it? Also, is rsh also split in client and server packages - and if so, which packages are those?
19001
I'm on Fedora 27 and experience problems with updating the packages by dnf update. The problem is exactly as described here:   I tried to delete symlink under /usr/lib, but can't, even under root:  vplagov@thinkpad:~ $ sudo rm -f /usr/lib/cpp  rm: cannot remove '/usr/lib/cpp': Operation not permitted ... vplagov@thinkpad:~ $ file /usr/lib/cpp  /usr/lib/cpp: symbolic link to ../bin/cpp ... vplagov@thinkpad:~ $ ls -al /usr/lib/cpp  lrwxrwxrwx. 1 root root 10 Sep 15 15:01 /usr/lib/cpp -&gt; ../bin/cpp   I see that file has a dot at the end of file permissions. By googling I found commands to remove the SELinux context or ACL (I don't know what are those). But still can't fix it:  vplagov@thinkpad:~ $ sudo setfacl -b /usr/lib/cpp ... vplagov@thinkpad:~ $ ls -al /usr/lib/cpp  lrwxrwxrwx. 1 root root 10 Sep 15 15:01 /usr/lib/cpp -&gt; ../bin/cpp ...  vplagov@thinkpad:~ $ sudo rm -f /usr/lib/cpp  rm: cannot remove '/usr/lib/cpp': Operation not permitted ... vplagov@thinkpad:~ $ sudo setfattr -x security.selinux /usr/lib/cpp  setfattr: /usr/lib/cpp: Permission denied   Is there a "healthy" option to fix this?
119365
I have Ubuntu 12.04 installed on my PC, recently I have edited /etc/passwd  and changed  user1:x:00:00:user1,,,:/home/user1:/bin/bash   to give root permission to user1 and the system always need to login as root, for running some custom software.  Now it seems the sound is not working, the volume icon is disabled. I understand that the pulseaudio demon can't be run as root that's why the audio is not working. How can I resolve it, like set the permission of pulseaudio to run as root.   When I type the command    /usr/bin/pulseaudio --start   Giving me the output  W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified). E: [autospawn] core-util.c: Home directory /home/user1 not ours. W: [autospawn] lock-autospawn.c: Cannot access autospawn lock. E: [pulseaudio] main.c: Failed to acquire autospawn lock   Edit   Solution for problem:  I have fixed the problem by disable root checking for pulseaudio equalizer  sed -i 's/exit 1/#exit1/g' /usr/bin/pulseaudio-equalizer
59557
This is happening on Ubuntu Release 12.04 (precise) 64-bit Kernel Linux 3.2.0-25-virtual  I'm trying to increase the number of open files allowed for a user. This is for my eclipse java application where the current limit of 1024 is not enough.  According to the posts I've found so far, I should be able to put lines into   /etc/security/limits.conf like this:  soft nofile 4096 hard nofile 4096   to increase the number of open files allowed for all users.  But that's not working for me and I think the problem is not related to that file.  For all users, the default limit is 1024, regardless of what is in /etc/security/limits.conf (I rebooted after changing that file)  $ ulimit -n 1024   Now, despite the entries in /etc/security/limits.conf I can't increase that:  $ ulimit -n 2048   -bash: ulimit: open files: cannot modify limit: Operation not permitted The weird part is that I can change the limit downwards, but can't change it upwards - even to go back to a number which is below the original limit:  $ ulimit -n 800 $ ulimit -n 800  $ ulimit -n 900  -bash: ulimit: open files: cannot modify limit: Operation not permitted   As root, I can change that limit to whatever I want, up or down. It doesn't even seem to care about the supposedly system-wide limit in /proc/sys/fs/file-max  # cat /proc/sys/fs/file-max 188897  # ulimit -n 188898 # ulimit -n  188898   But even I get eclipse to run as root, my application still crashes because of "Too Many Open File" exception!   So far, I haven't found any way to increase the open files limit for a non-root user.  How should I properly do this? I have looked at several other posts but no luck!
104297
On my arch server, I was setting up users restricted to their home directories. I ran:  useradd -m -s /bin/bash username and passwd username  I've read   I figured I should use systemd user services to make each user run a node server on startup. So i logged into one user account su username and created a file ~/.config/systemd/user/serve.service containing:  [Unit] Description=One of the servers  [Service] ExecStart=/usr/bin/node /home/username/server.js  [Install] WantedBy=default.target   then I ran systemctl --user enable serve.service which responded with Failed to connect to bus: Permission denied  As far as I understand I should run systemctl --user ... command logged in as a user and not as root.  So what did I miss in this configuration?
88731
for normal user I get :     /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/monty/google_appengine   which is actually the content of /etc/environment  For root I get:     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin   what's the reason behind this and which file contains this line?
74027
Doing "ls" gives me absolutely no response. No "command not found", no "permission denied", absolutely nothing. I'm really confused. Please help.  Info: Running Ubuntu Server 16.04.4 on a Digital Ocean VM, 1 GB, 1 vCPU.
92887
I installed CentOS 5.5 on my VMWare 8 recently and I am trying to add a new user on the system. I am unable to add the user unless I use su - option. I believe it has to do something with path not set properly.  I updated the path and here is what it looks like  /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/uone/bin:/sbin   I believe the command is in /sbin dir which is already a part of path. Can anyone suggest me what else I might be missing?
82916
So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?  Update:  So I opened terminall and typed into it  command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a    nohup ./cloud-updater-linux.sh  &gt;&amp; /dev/null &amp;... but after some time  I saw:    (which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)  But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What did I get wrong? How to make a terminal and all sub processes it launches be limited on ram usage?
42821
On my NFS server, I have the following export defined:  #NFS exports Database /shared -alldirs -network=192.168.1 -mask=255.255.255.0   On my NFS client:  192.168.1.7:/shared /shared nfs rw 0 0   Obviously, as root on the server, I can do whatever I want.  On the client however, my regular user 'gabe' can make changes to the nfs mount (assuming I have permissions to), but root cannot.    As my regular user:   gabe@client$ cd /shared gabe@client$ ls -l total 8 drwxrwxrwx  4 gabe  wheel   512 Mar 20 19:20 tmp gabe@client$ cd tmp gabe@client$ touch test.txt gabe@client$ rm test.txt   As root:  # cd /shared/tmp # touch test.txt touch: test.txt: Permission denied   Again, this is all on the NFS client side of things, and I suspect perhaps it has something to do with the -maproot option.  This is the first time I'm setting up NFS and I just noticed this peculiarity.  I'm going to do some reading now, to see if I can figure this out, but if anyone has any insight, I would appreciate it.
6240
I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.  The trouble is, this contrived example doesn't work:  sudo ls -hal /root/ &gt; /root/test.out   I just receive the response:  -bash: /root/test.out: Permission denied   How can I get this to work?
44810
For whatever reason, we do no longer need to be root (or using sudo) to run /sbin/shutdown, /sbin/reboot etc.  This seems to be because those executables are now symlinks to /bin/systemctl which handles everything as normal user.  However, what if I want shutdown and reboot to require root authentication again? How can I achieve this?
80226
I want to execute stat command in my unix shell /usr/bin/ksh:  Input:  /bin/date +%Y%m%d%H%M%S -d "$(/usr/bin/stat -c %x find.txt)"   And the output:  /usr/bin/ksh: stat:  not found   My system: SunOS 5.10 Generic_150400-23 sun4v sparc sun4v
36674
In Ubuntu 11.04 I could mount a file system in /media/foo and run chown guest:guest /media/foo/bar -R and have full access in the guest account. After the upgrade to 12.04 I changed my routine to reflect the new guest usernames (chown guest[id]:guest[id] /media/foo/bar -R) but I still can't access it as a guest user, as I don't have access privileges to /media as guest:     ls: cannot open directory /media: Permission denied   (Very interestingly this does work if I su into the guest account as root). I understand this is meant as a  but I don't see how it is done. ls -l / reports   drwxr-xr-x  11 root root  4096 Sep  9 22:28 media   Thus my two questions: How does this restriction work and how can I access a mounted file system as a guest user, ideally without allowing access to all of the other mounted file systems?
93918
I love Linux and everything she stands for; however, unfortunately I grew up with Windows. Thusly so I have learned very bad practices (such as NT Authority will protect me). I have several Linux VPS's for personal and educational uses and I manage all of them from the command line. Through the management of these servers I have learned very painful lessons of the power of the Root user. Such as:   rm -d -R /* chown www-user:www-user -R /* Etc.    I've only removed my root directory twice, but just last week I changed the permission of the whole drive - effectively locking the Root out.   Now I know that I should never be logged in as Root, but most of the time I have to deal with files that only the Root owns so I sudo and run the command.   So my question is, is there a way to prompt the user (who is root, or sudo'ed) when a potentially hazardous command is executed, so the user may rethink their decision? Possibly through scripts in Bash, or a different sudo wrapper.   Or (I ask this hopefully, and very simplified) is there a way to set up permissions where instead of a two tier user system (Root user, regular user) there is a three tier system like in Windows (NT Authority, Administrator, other User). Basically is there a way to keep the ability of System administration, but restrict access to some system files.
11913
I have this command to backup a remote machine. The problem is that I need root rights to read and copy all files. I have no root user enabled for security reasons and use sudo the Ubuntu way. Would I need some cool piping or something to do this?  rsync -chavzP --stats user@192.168.1.2:/ /media/backupdisk/myserverbackup/