4

Just installed a turnkey linux ubuntu/apache/tomcat vm image. After some trouble getting the bridged network adapter installed on win7, I wanted to check network access to and from the vm. Verified that I could hit the vm's web server from the host, and wanted to test that I could also hit the internet from the vm, so I did this on the shell cmd line:

curl www.google.com

Which responded with this:

-sh: curl: not found

Wanting to make sure it wasn't busted networking, I tried this, and got the same response:

curl localhost

That leads me to think that wasn't curl saying it can't find the requested url, but the shell saying it can't find the curl cmd. So I did this:

sudo apt-get install curl

Response was:

-sh: sudo: not found

So now I'm confused. Sudo has to be installed, doesn't it, and apt-get? Both because they're fundamental I think, and because you couldn't install anything else without them, if you see what I mean.

Is it a security issue, that my account (which I just created via webmin) doesn't have rights to sudo? I added myself to the secondary group 'sudo' via webmin, though I wasn't sure that was legit, logged out and back in, no change, so I undid it.

I read that /etc/sudoers controls access to sudo, but as far as I can tell from both the cmd line and the webmin text editor open file dlg, it doesn't exist. Do I need to create it? Is it normal to have to do that, or a system defect?

Or is it something else that my ignorant self is or isn't doing?

1
  • On a semi-related note, you can install stuff without apt-get (even package managers like apt-get itself) using the old make; sudo make install procedure. Regarding sudo, you can use su root -r 'command...' or something like that, I think. It's just a bit more awkward, but possible. May 29, 2013 at 0:36

4 Answers 4

7

Whilst Turnkey Linux is based on Ubuntu (and is binary compatible - and in fact is mostly constructed of vanilla Ubuntu packages), it isn't strictly Ubuntu and has a number of customisations.

So sudo is not installed by default in TKL appliances. On a desktop it is a really good idea to have the root account disabled and use sudo instead (as Ubuntu is by default). IMO (and the TKL dev's) this rationale does not apply to servers.

With this setup sudo is generally not required. For general admin just use root (and so no need for sudo). If you want additional users you probably don't want them having admin (sudo) privileges anyway.

So to install curl (or any other command) just omit the sudo eg

apt-get install curl

If you want sudo then just install it

 apt-get install sudo
1
  • I understand the thinking, thanks. As a long-time web app dev just learning linux (especially w/o a GUI), I need admin access to get my web stacks in place, but sometimes I also want to live life as a "normal" user, together more the TKL desktop security model. If I wasn't so new to linux, I would have immediately recognized what was going on and easily worked around it. As it was, I had no idea it was even possible to create a linux system w/o sudo, so I thought I was even more clueless than I actually am, or that the install was broken. Is this documented? I have to admit, I didn't RTFTKLM.
    – enigment
    Jan 9, 2012 at 12:36
2

from this forum post http://www.turnkeylinux.org/forum/support/20110125/sudo-command-not-found-turnkeylinux-drupal6 it looks like, sudo isn't installed by default on turnkeylinux. It features some help on how to install it as well.

If there are more problems with turnkey you should probably continue to ask there, since it seems to be a heavily specialized ubuntu fork.

2

Probably your PATH is wrong. sudo is located in /usr/bin folder. Try to run the complete path:

/usr/bin/sudo -i

Then:

apt-get install curl

Is there any special reason to use sh instead of bash?

10
  • (I was actually switching between sh and bash, just to make sure that wasn't relevant. Posted the sh results here as less verbose, but I'll just omit the prompt from here on out. And thanks to all for their assists!) From /usr/bin/, 'ls s*' doesn't show sudo, which I would take to mean it's not there. Could it be somewhere else, or is something busted or weird in this install?
    – enigment
    Jan 8, 2012 at 17:14
  • No sudo? Yes, probably a bad installation... The ubuntu-minimal package depends on sudo. No sudo, no administrative tasks, no server. Jan 8, 2012 at 17:26
  • Oh... turnkey linux... Had the installer asked you a root password? Jan 8, 2012 at 17:30
  • Yes, and I know it. What next?
    – enigment
    Jan 8, 2012 at 18:07
  • you can type in the shell "su" then enter your password and then install stuff just by typing apt-get install without sudo in front of it
    – Daniel W.
    Jan 8, 2012 at 18:20
0

Could you try the command?

sudo -i

It should ask you for your password and then log you in as root user.
If it works type

exit

to log yourself out again.
That would verify that you have sudo rights.

5
  • I get -sh: sudo: not found. So I don't have sudo rights then?
    – enigment
    Jan 8, 2012 at 17:04
  • no..that's just weird...it means, that it doesn't find the command sudo. I didn't really get in what kind of environment you are. Is it a virtual machine?
    – Daniel W.
    Jan 8, 2012 at 17:09
  • It's a vm created from the turnkey linux tomcat on apache appliance. Seems to me like sudo is so fundamental, it'd have to be there, regardless of the specifics of the vm.
    – enigment
    Jan 8, 2012 at 17:20
  • it seems unnatural for ubuntu not to have sudo, so I would say the install seems busted. Maybe you can download the sudo binary package from here gratisoft.us/sudo/download.html and let the .deb package install it
    – Daniel W.
    Jan 8, 2012 at 17:23
  • @DanielW.- very (very, very) late response, it's not busted, sudo is not included intentionally. I'm not going to repeat the rationale right now, but it's well documented if you're interested. If you want sudo, install it: 'apt-get install sudo' Nov 16, 2023 at 0:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .