su or sudo "command not found"

Introduce yourself to us and other members here, or share your own product reviews, suggestions, and tips and tricks of using QNAP products.
Post Reply
rogsf
Getting the hang of things
Posts: 65
Joined: Sun Mar 06, 2011 5:40 pm

su or sudo "command not found"

Post by rogsf » Mon Mar 16, 2015 1:12 am

Hi,

Trying to do "su - admin" or "sudo", and I got "command not found".

Is there some env parameters that I need to set?

[~] # su - admin
-sh: su: command not found
[~] # sudo
-sh: sudo: command not found
[~] #



Thanks in advance.

User avatar
forkless
Experience counts
Posts: 1914
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: su or sudo "command not found"

Post by forkless » Mon Mar 16, 2015 3:18 am

Your 'admin' user is uid 0 (root)

rogsf
Getting the hang of things
Posts: 65
Joined: Sun Mar 06, 2011 5:40 pm

Re: su or sudo "command not found"

Post by rogsf » Mon Mar 16, 2015 6:03 am

Hi Forkless,

Thanks for replying. How about "sudo" command? it's said it's not found.

User avatar
pwilson
Guru
Posts: 22568
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: su or sudo "command not found"

Post by pwilson » Mon Mar 16, 2015 6:54 am

rogsf wrote:Hi Forkless,

Thanks for replying. How about "sudo" command? it's said it's not found.


Sudo is not part of the Firmware image. It never was.

You can install "sudo" via both Optware and Entware.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.

User avatar
schumaku
Guru
Posts: 43664
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: su or sudo "command not found"

Post by schumaku » Tue Mar 17, 2015 11:01 pm

..to su from admin uid:0 or sudo to admin uid:0 ... ? If login using admin you are already admin (uid:0 .. elsewhere named root).

User avatar
pwilson
Guru
Posts: 22568
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: su or sudo "command not found"

Post by pwilson » Wed Mar 18, 2015 10:21 am

schumaku wrote:..to su from admin uid:0 or sudo to admin uid:0 ... ? If login using admin you are already admin (uid:0 .. elsewhere named root).


as evidenced with:

Code: Select all

/usr/bin/id -a
uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone),1012(kvm),1013(libvirtd)

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.

rogsf
Getting the hang of things
Posts: 65
Joined: Sun Mar 06, 2011 5:40 pm

Re: su or sudo "command not found"

Post by rogsf » Sun Mar 22, 2015 1:18 pm

Thanks Patrick and schumaku for your help

erdems
New here
Posts: 5
Joined: Thu Feb 28, 2013 8:24 pm

Re: su or sudo "command not found"

Post by erdems » Sun May 03, 2015 2:11 pm

Found this one while looking for a solution to the same problem.

In case you want to su to another user in your NAS for whatever reason (i.e. run a cron job with that user in that user's home etc.); an alternative is to install coreutils package:


Code: Select all

ipkg update ; ipkg install coreutils



Cheers,
Erdem

User avatar
spamkutu
Know my way around
Posts: 114
Joined: Sun Aug 09, 2015 4:09 pm

Re: su or sudo "command not found"

Post by spamkutu » Fri Aug 14, 2015 12:45 am

pwilson wrote:You can install "sudo" via both Optware and Entware.


What is Entware and how to install please and also Optware in Qnap.. :|
Model name: TVS-EC-1080 + 24GB RAM
Firmware version: 4.1.4 20150910 stable
Operation System (OS): Windows XP/7/8.1/2012SR2 ; Slackware 14.1
Number of HDDs: 8 Segate NAS ST4000VN000-1H4168 ; 4TB each ; First 4 in Raid 5 , Next 4 in Raid 5
Services enabled: DDNS, NFS, SMB, SSH, SysLog, LDAP, Photo, Music, File and Download Station
NAS connection speed/ MTU: 1Gbps / 1500

User avatar
dolbyman
Guru
Posts: 20496
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: su or sudo "command not found"

Post by dolbyman » Fri Aug 14, 2015 1:11 am


User avatar
schumaku
Guru
Posts: 43664
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: su or sudo "command not found"

Post by schumaku » Fri Aug 14, 2015 1:17 am

For Entware, start here -> viewtopic.php?f=320&t=100843&start=135

Optware is an obsolete package manager, much more incomplete.

But ey, what for you need sudo if there is no login for any users different from admin anyway? Better don't expose the non-default OpenSSH sshd to the Internet - seriously...

User avatar
spamkutu
Know my way around
Posts: 114
Joined: Sun Aug 09, 2015 4:09 pm

Re: su or sudo "command not found"

Post by spamkutu » Fri Aug 14, 2015 1:27 am

schumaku wrote:
But ey, what for you need sudo if there is no login for any users different from admin anyway? Better don't expose the non-default OpenSSH sshd to the Internet - seriously...


Maybe he could disable default admin and put to another users as a substitute a sudoers to fear somethings corrupt.
Model name: TVS-EC-1080 + 24GB RAM
Firmware version: 4.1.4 20150910 stable
Operation System (OS): Windows XP/7/8.1/2012SR2 ; Slackware 14.1
Number of HDDs: 8 Segate NAS ST4000VN000-1H4168 ; 4TB each ; First 4 in Raid 5 , Next 4 in Raid 5
Services enabled: DDNS, NFS, SMB, SSH, SysLog, LDAP, Photo, Music, File and Download Station
NAS connection speed/ MTU: 1Gbps / 1500

musabasjo
New here
Posts: 5
Joined: Tue Dec 16, 2014 12:17 am

Re: su or sudo "command not found"

Post by musabasjo » Fri Aug 28, 2015 3:44 pm

I know very little. Statement.

I apparently need the command sudo to get a beta weather program called cumulus to work on my QNAP 212P NAS. I have winscp and putty programs and copied cumulus files to /usr/bin/CumuluxMX folder. I need to run mono (already installed via qpkg) and cumulusmx.exe and told to type
sudo mono CumulusMX.exe

There is no version of Outward for qnap that I can find and entware looks very complicated to get on to the qnap. I need very simple instructions on how to install sudo .

Can anyone help?

David

User avatar
schumaku
Guru
Posts: 43664
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: su or sudo "command not found"

Post by schumaku » Fri Aug 28, 2015 4:30 pm

Hi David,

Appears a pre-requirement for CumulusMX is the availability of Mono. To keep the story short - here the part applicable to U**x-derivatives, to the QNAP NAS in general, and your TS-212 in special.

- sudo is a program for U**x-like computer operating systems that allows users to run programs with the security privileges of another user, by default the user with hte uid:0, often named root.
- On the QNAP NAS, admin _is_ running as uid:0 - so no need for sudo.
- QNAP does offer Mono for x86 based (Intel, AMD) NAS models only - either form the App Center, or form the community builds -> viewtopic.php?f=214&t=109446#p477383

To conclude (your?) thread here ... http://sandaysoft.com/forum/viewtopic.php?f=27&t=14232 ... the problem is not sudo ... much more mono. And then the fact that QNAP does not add each and every binary path to the path variable, and you might have to call the binary by using it's relative or full path. But that's beyond of the scope here.

Last ... just "blindy" using copy or move commands workable on generic U*x platforms will cause issues on an embedded system as we have here on the QNAP NAS. I'm shuddering to read about ideas of copy a what is supposed to be a Web application to /root or to /usr/bin ...

Regards,
-Kurt.

musabasjo
New here
Posts: 5
Joined: Tue Dec 16, 2014 12:17 am

Re: su or sudo "command not found"

Post by musabasjo » Fri Aug 28, 2015 7:45 pm

Ah..... time to give up and perhaps dig out my old HP ProLiant microserver (runs on windows home server).
Many thanks for your full and understandable explanation.

Regards. David.

Post Reply

Return to “Users' Corner”