[NTLUG:Discuss] C Program Woes on Ubuntu
Jay Urish
jay at unixwolf.net
Thu May 31 12:25:03 PDT 2018
SElinux?
On 05/31/2018 01:39 PM, George Lass wrote:
> I'm not exactly sure why, but apparently Ubuntu will not allow execution of *anything* in sub directories below /run. I was logged into my server via ssh as root (not sudo'ed). I created a directory called bin (/run/bin) and tried to build and execute my C program there. Copying the executable *anywhere* else allows it to be executed.
> Thanks all,
> George
>
> From: Lee Heath <madhat at gmail.com>
> To: George Lass <george.lass at sbcglobal.net>; NTLUG Discussion List <discuss at ntlug.org>
> Sent: Thursday, May 31, 2018 12:47 PM
> Subject: Re: [NTLUG:Discuss] C Program Woes on Ubuntu
>
> Do you have selinux enabled?
> https://en.wikipedia.org/wiki/Security-Enhanced_Linux
>
> $ sudo getenforce
> [sudo] password for me:
> Disabled
>
> Have you check the logs?
>
> $ sudo grep -r x-bash /var/log/*
>
>
>> On May 31, 2018, at 12:26 PM, George Lass <george.lass at sbcglobal.net> wrote:
>>
>> I have just installed Ubuntu 18.04 LTS on a 4 or 5 year old Dell PowerEdge R210 II. I have updated and upgraded to the latest versions of everything. I am having problems trying to execute even the simplest C Language program:
>> #include <stdio.h>
>> int main(int argc, char *argv[]){ printf("this is a test"); return 0;}
>>
>> No problem building the executable from the source file x.c:
>> # make xcc x.c -o x
>> But I am unable to actually run the executable:
>> # ./x-bash: ./x: Permission denied
>>
>> It isn't a problem with file permission:
>> # ls -l x-rwxr-xr-x 1 root root 8288 May 31 12:19 x
>>
>> And I don't *think* it's a compatibility issue with shared objects since it seems to use the same library as bash:
>> # file xx: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=4167fc090a21cefc7aa84aae77c4203bb35ac56b, not stripped
>>
>> # file /bin/bash/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=b636f50d85c3cca7cf2518030446660c1d90d660, stripped
>> Does anyone have any ideas as to what is going on?
>> Thanks,
>> George Lass
>>
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
> Lee Heath
> InfoSec Mercenary
> @unspecific
>
>
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
More information about the Discuss
mailing list