LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-27-2015, 09:06 PM   #1
MilesOfRoses
LQ Newbie
 
Registered: Nov 2015
Posts: 4

Rep: Reputation: Disabled
"Command not found" on my server? “bash: sudo: command not found”?


I'm trying to get my server setup so that I can deploy my first rails app, but when I log into my server via SSH on the command line and try to run this command:

Code:
milesros@serv01 [~]# sudo adduser myappuser
I keep getting this error:

Code:
-bash: sudo: command not found
It looks like the server isn't responding to the 'sudo' command. however, if I omit 'sudo' and just type the command:

Code:
milesros@serv01 [~]# adduser myappuser
I'm greeted with this error instead

Code:
-bash: adduser: command not found
It seems like a number of crucial commands are not being recognised by my server's command line (even 'apt-get'!)

I was able to run the command
Code:
compgen -c
from my server to get a list of all the available commands, but I didn't see sudo adduser apt-get etc. (though there was still a long list of commands, I could post them if it would help)

The commands seem to work just fine when I'm entering commands on my local machine, but as soon as I log into the server, I keep getting 'command not found' errors.

I'm running Ubuntu 14.04, and my hosting is with SiteGround (their servers run linux CentOS)

Also, if it helps I have been following this tutorial on deploying a rails app by Phusion Passenger up to this point https://www.phusionpassenger.com/lib...eploy_app.html

Any tips or advice would greatly appreciated, I've been at this for hours
 
Old 12-27-2015, 09:18 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,987
Blog Entries: 11

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
What you are running locally does not matter. Only the server OS and configuration matter.

What type of hosting account do you have? Shared, dedicated server, VPS? Do you have root access? Etc., etc...

Have you checked the provider documentation?
 
Old 12-27-2015, 09:35 PM   #3
MilesOfRoses
LQ Newbie
 
Registered: Nov 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have a shared hosting account with SiteGround, but since it's a shared hosting plan, I don't have ssh root access to the server. I have gone through the Phusion Passenger documentation, but haven't found a solution yet. Actually, the tutorial that I've been following up to this point is actually part of Phusion's documentation.
 
Old 12-27-2015, 10:06 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,987
Blog Entries: 11

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Quote:
Originally Posted by MilesOfRoses View Post
I have a shared hosting account with SiteGround, but since it's a shared hosting plan, I don't have ssh root access to the server. I have gone through the Phusion Passenger documentation, but haven't found a solution yet. Actually, the tutorial that I've been following up to this point is actually part of Phusion's documentation.
Well, on a shared hosting plan you are almost certainly not going to have sudo, nor the ability to add users, nor any sort of server admin access such as ability to install packages, etc. Whatever your tutorial says probably assumes that you do have root access, so it will probably not be applicable to your SiteGround platform.
 
Old 12-28-2015, 03:24 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,308
Blog Entries: 8

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
^ and i fear that is all there is to it.

but for the sake of completeness:
- you don't need sudo. try 'su' instead (just 'su', not adding any command after that. it should ask for your root password, which is not the same as your user password)
- the '#' prompt kinda implies that you are root already. enter "whoami" to see who you are.
- CentOS does not use apt-get, because apt-get is debian specific.
 
Old 12-28-2015, 08:22 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,372
Blog Entries: 37

Rep: Reputation: Disabled
Trust us, Shared Hosting accounts do not get "root".
Contact Siteground support.
 
Old 12-28-2015, 08:52 AM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,184

Rep: Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163
I feel I should also pint out that "apt-get" is a Debian program and won't work under CentOS which would use YUM or, at some point, DNF.
It might be as well to read up on Linux distributions if you're going to be spending money on running one.
 
Old 04-01-2016, 09:19 AM   #8
Coop31
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
If you are running Debian or Ubuntu and would like to run any command with the Sudo and got an error '-bash: Sudo: command not found' , you probably have no sudo pre installed. To solve the issue create a superuser and enter the 'su' command in shell script. Then you enter the password of the root and continue running the command but with root privileges: 'apt-get install Sudo'
Everything should work upon completion.

IMPORTANT: For the current user to execute commands with root privileges using Sudo he/she must be a member of the corresponding group. To add a user to the sudo group, run the following command: 'usermod -a -G sudo user*'
*('user' is an actual user name)
More on such specifics can be found here

Last edited by Coop31; 04-01-2016 at 09:21 AM.
 
  


Reply

Tags
command, error, rails, server, ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] When I type "sudo grub" it says "command not found" in Ubuntu 9.10 Live CD. msbstar Linux - Newbie 9 07-17-2017 12:27 PM
[SOLVED] complete noob question. "command not found" "command not found" jeanlucpicard Linux - Newbie 4 08-27-2013 02:14 AM
[SOLVED] "bash : links :command not found" error in apache server piyusharora420 Linux - Newbie 2 11-07-2010 01:16 AM
When I type "sudo grub" it says "command not found" in Ubuntu 10.10 poumtatalia Linux - Newbie 5 09-14-2010 05:21 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration