0

Background: I installed Ubuntu 14.04.2 LTS and would like to install and use Aptana (and Java). Google pointed me to the guide how to do this and i successfully did this under the initial Ubuntu account with administrative privileges. (this way: http://goo.gl/N5I1eW) However, as far as i understand, it is not safe to use the admin account daily. So, i created a standard account, but standard account does not have access to whatever i installed under the admin account and it may not sudo or install software. I am back to the clean Ubuntu 14.04.2 LTS with the admin and the standard users now. I could not find any guides about installing software for other users so far.

Not a duplicate of anything because: the new dimension of this question is related to security - installing Aptana for use not under the admin's account, but by admin to be used under the standard user's account. As a newbie, I am not sure of the finer details and would appreciate a clarification by a more experienced Ubuntu user.

viDim
  • 23
  • 1
    You should edit your question and add a link to the guide you where following. Installing software via software-center (gui) or apt (cli) makes it available for all users. – mgor Aug 05 '15 at 21:14
  • ^^^^^^ Read and adapt my answer. – A.B. Aug 06 '15 at 05:29
  • @mgor: Is this (http://goo.gl/N5I1eW) the complete and safe way to install Aptana by admin to be used by the user without admin privileges? Is Aptana installed this way by admin under admin's account available for the standard user to use? Is the only thing left to do for the standard user creating a correct .desktop file under the standard account? Would it be correct to create the same .desktop file as the one under the admin account? What would the code of a correct .desktop file for the standard user look like? – viDim Aug 06 '15 at 05:53
  • @A.B. There is no answer to my question there "Installing Eclipse IDEs for Java and C/C++" http://askubuntu.com/questions/656561/installing-eclipse-ides-for-java-and-c-c – viDim Aug 06 '15 at 06:42
  • It is not necessary and probably less safe to clutter the admin account with Java. How it shall be installed by the admin for the standard user to use, into standard user's account? – viDim Aug 06 '15 at 20:16

1 Answers1

1

In most cases, installing applications for all users on Ubuntu requires root access. Binaries are installed in /usr/bin, which is writable only by root, and likewise for other installed files.

The usual way to install packages from the command line is using the apt-get tool, running under sudo:

sudo apt-get install package-name

If you run this from an account that has sudo access, it will prompt for your password and then run the command as root.

There are also GUI package managers; they'll prompt for your password when you do anything that requires root access.

However, as far as i understand, it is not safe to use the admin account daily.

It's not safe to run an interactive shell under the root account. It's too easy for a typo in a command to mess up your system. That's why sudo exists -- so you can (carefully!) execute individual commands as root while being logged in as an ordinary user.

I suppose that setting up one user account with sudo access, and another user account without sudo access (and using the latter for most purposes) is slightly safer than giving your usual user account sudo access. I've never bothered to do that myself. If the system is not shared with other users, I suggest just configuring your own account with sudo access and being careful about what you use it for. You'll have root access, but you won't be able to use it accidentally; typing sudo will be a reminder that you're doing something that could be dangerous.

Based on the information in this question, it looks like Aptana has to be installed by unzipping a downloaded file under /opt. The same considerations apply. Rather than running apt-get install under sudo, you'll just run unzip under sudo.

It's good to be cautious, even a bit paranoid, about using root privileges -- but if you need to install software, you need to use your root privileges.

Some software can be configured for installation under your home directory, to be used only from your own user account. On the other hand, some software is preconfigured to assume that, for example, its binaries are under /usr/bin. I don't know whether you can install Aptana under an ordinary user account. But judging from the answer to the linked question, I'd probably just go ahead and install it under /opt. There's always a risk in installing any third-party software, but people do it all the time.

On further thought, let me clarify some points.

There are (to an initial rough approximation) three kinds of accounts on the system:

  1. The root account. This account can do anything on the system: install software, read other users' files, reformat the disk. In normal usage, you should probably never login to this account.

  2. One or more administrative users. These are people who are trusted to use root privileges, for example to install software packages to be used by everyone on the system. Each administrative user can use the sudo command.

  3. Zero or more non-administrative users. These users do not have sudo access, and cannot install software outside their own home directories.

The systems I use have a single administrative user (me) and no non-administrative users, since I either own or control the entire system for my own use. A multi-user system will of course have more accounts.

It's also possible to modify the sudoers file to permit some users to run only certain commands as root; those users would be somewhere between 2 and 3 in the above list.

If you're the only user of the system (something that wasn't clear from your question), just set up a user account for yourself with sudo privileges. Use sudo only for administrative activities like installing software.

(Sorry about the length of this answer. I haven't had time to make it shorter.)

  • Thank you for your attention. Nobody else cares to answer. Basically, you suggest giving the standard user sudo rights. There probably is a way to achieve the aim i have in mind. Since Aptana is not available in the repository anyway, and the admin has a system-wide access, he can unpack Aptana in the home directory of the standard user and then add him to the access rights of the folder with Aptana. I now wonder whether i can do the same with Java - put it in the home directory of the standard user and install it just for him to use and keep the admin account clean. – viDim Aug 06 '15 at 21:56
  • @viDim: Depends on what you mean by "the standard user". There needs to be a non-root account that can use sudo. You can login to that account and use sudo to install software. Depending on how the system is being used (multiple non-admin users? just you?) you may or may not want to set up additional accounts without sudo access. Users logging into those accounts will not be able to install software under the root directory (though they may be able to install some software under their home directories). – Keith Thompson Aug 06 '15 at 22:07
  • @viDim: I've updated my answer; the new material starts at "On further thought". – Keith Thompson Aug 06 '15 at 22:13
  • Would it be safe to give standard user sudo rights just for installing Java and Aptana and then just to revoke sudo rights, maybe also add him to the access rights of the folder with Aptana? Will it all work? – viDim Aug 06 '15 at 22:14
  • @viDim: I have no idea. How much to do you trust the "standard user(s)"? Why do you want to give them permission to install the software rather than installing it yourself? – Keith Thompson Aug 06 '15 at 22:17
  • By "standard user" i mean the name of the type of account as stated in the User Accounts window. When one account is selected, the second line in the details states "Account Type Standard". – viDim Aug 06 '15 at 22:27
  • The matter of how much i trust the standard user is based on the fact that i would like to use that account daily, and avoid using the admin account with sudo rights. I would like temporarily to give the standard account sudo rights because I do not know how the admin can install Java just for the standard user to use. Maybe I can use su for that? I tried using su under the standard account. It works, it just asks for the admin password. – viDim Aug 06 '15 at 22:36
  • Assuming you're the administrator and there are other users using the system, you'll have to decide what privileges to give them. It's usually best to give each user the minimal privileges needed (within reason), but it's up to the person in control of the system -- in this case, you. Question: Are you the only user (in the sense of a human being, not a Unix account) on the system? – Keith Thompson Aug 06 '15 at 22:36
  • There is just one user of the system - me and i'd like to use it daily under the standard account. Which is better to use for installing software for the standard user by the admin: to temporarily give the standard user sudo rights OR use su? How shall this be done in case of Java, if su is better? – viDim Aug 06 '15 at 22:42
  • I've updated my answer. Just use sudo. Since you're the only user, there's no point in setting up an account that doesn't have sudo privileges. – Keith Thompson Aug 06 '15 at 22:59
  • Thank you. Maybe you're right and using daily the standard account with sudo rights is safe. OR maybe revoking the sudo rights after the installation and using daily the account without sudo rights is even safer. The point of that is possibly the increased protection from the outside threats. – viDim Aug 06 '15 at 23:31
  • This is a ridiculous answer. I also want to install software for "standard user" using my account .. (for a keyboard layout program) I installed it on the admin account and it does not work in the standard user. I tried using my password (admin password, but it only wants the standard user pwd when I type sudo). – Bhikkhu Subhuti Dec 27 '17 at 03:44
  • @BhikkhuSubhuti Sounds like something went wrong with the installation of a particular package. You might consider posting a new question with the specifics of your own situation. – Keith Thompson Dec 27 '17 at 05:31