LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 06-11-2010, 08:01 PM   #1
nkedz
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
lfs is not in sudoers file error in LFS 6.6


Hello all,

I started to work on my LFS system a few days ago and was impressed with everything going smoothly. However, I think I might have done something wrong. I thought I had followed the instructions in the book to the letter, but maybe someone can point me in the right direction?

I'm using Ubuntu 10.04 as a host system, LFS version 6.6, and am only somewhat new to Linux. If I can put anything else here that would help my question be answered, please let me know.

My problem is this: I have gotten all the way to section 5.4, and it's time to build Binutils-2.20. I am executing these commands as lfs, as specified. The first command is
Code:
mkdir -v ../binutils-build
and when I try it, it says permission denied. I try
Code:
sudo mkdir -v ../binutils-build
and enter my password when prompted, but then I get the error message "lfs is not in the sudoers file. This incident will be reported."

Where could I have gone wrong? I'm very sure I followed the instructions in the book to the letter. If additional details are needed, please let me know, and thanks in advance for any help, it is much appreciated!
 
Old 06-12-2010, 03:03 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi,

check the permissions and owner of
Code:
$LFS/sources
$LFS/tools
They should both belong to lfs and should also have rwx permission. If necessary change permissions as needed.

Hope this helps.
 
Old 03-04-2013, 04:47 AM   #3
smdaudhilbe
Member
 
Registered: Feb 2013
Posts: 43

Rep: Reputation: Disabled
binutils problem

Mee too facing the same problem....

please share me any suggestion to get rid of such problem....

Not able to run the patch, of binutils....

thanks,
Audhil
 
Old 03-04-2013, 05:39 AM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Wink

Hi
What version of lfs are you building
what chapter are you on
 
Old 03-04-2013, 06:35 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by smdaudhilbe View Post
Mee too facing the same problem....

please share me any suggestion to get rid of such problem....

Not able to run the patch, of binutils....
There's not much to go on (see spiky0011's post).

Just to make sure: You also get the "lfs is not in the sudoers file. This incident will be reported." message?

If so, the solution is simple: You should not use sudo when building lfs, you need a full blown root account (su - ) and then start building lfs.
 
Old 03-04-2013, 08:54 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Post the output of version-check
also
Code:
ls -l /mnt/lfs
Code:
ls -l /mnt/lfs/source
Dont fotget post4

Last edited by spiky0011; 03-05-2013 at 02:04 AM.
 
Old 03-04-2013, 11:17 PM   #7
smdaudhilbe
Member
 
Registered: Feb 2013
Posts: 43

Rep: Reputation: Disabled
binutils problem

I am building lfs version 7.2...

As per druuna's advice if I become root using su - command, if I may do anything wrong will cause me severe damage...For the sake of security I created (as per the direction given in LFS) a new user lfs to avoid such situations...

How to overcome..this..?

Please suggest me hints to add my new user lfs into sudoers config file, it will be very helpful... to me...

-Audhil...
 
Old 03-05-2013, 01:00 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by smdaudhilbe View Post
As per druuna's advice if I become root using su - command, if I may do anything wrong will cause me severe damage...For the sake of security I created (as per the direction given in LFS) a new user lfs to avoid such situations...

How to overcome..this..?

Please suggest me hints to add my new user lfs into sudoers config file, it will be very helpful... to me...
The use of sudo while building LFS is discouraged and the LFS book also points to using su -. I've seen too many posts were people used sudo and got stuck at some point during the build.

When you build an LFS system you do need the full power of the root user (only chapter 5 is done as the lfs user).

If you don't feel comfortable using root on the machine you do your daily routines I would suggest setting up a virtual machine, install a host and build LFS inside the VM. This way you can only foobar your VM session.
 
Old 03-05-2013, 02:04 AM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Hi

At what point/chapter are you using sudo? pls
 
Old 03-05-2013, 04:46 AM   #10
smdaudhilbe
Member
 
Registered: Feb 2013
Posts: 43

Rep: Reputation: Disabled
Unhappy binutils problem

Hi,

After big research, I found solution to my problem....I followed these steps...

1) Earlier I found errors like this

lfs@boss:/media/LFS$ mkdir audhil
mkdir: cannot create directory `audhil': Permission denied
lfs@boss:/media/LFS$ sudo mkdir audhil
[sudo] password for lfs:
Sorry, try again.
[sudo] password for lfs:
lfs is not in the sudoers file. This incident will be reported. <-- I got this after entering my correct password of lfs user
lfs@boss:/media/LFS$

2) After, adding a line

%lfs ALL=(ALL) NOPASSWD: ALL

at bottom of /etc/sudoers file

It works pretty good,

lfs@boss:/media/LFS$ mkdir audhil
mkdir: cannot create directory `audhil': Permission denied
lfs@boss:/media/LFS$ sudo mkdir audhil
lfs@boss:/media/LFS$ ls
audhil lost+found sources tools
lfs@boss:/media/LFS$ rm audhil -R
rm: remove write-protected directory `audhil'? y
rm: cannot remove `audhil': Permission denied
lfs@boss:/media/LFS$ sudo rm audhil -R
lfs@boss:~$

But the problem is I need to enter sudo each and every time, even for a simple task as follows,

lfs@boss:/media/LFS$ sudo vim dummy.c
lfs@boss:/media/LFS$ gcc dummy.c
/usr/bin/ld: cannot open output file a.out: Permission denied
collect2: ld returned 1 exit status
lfs@boss:/media/LFS$ sudo gcc dummy.c
lfs@boss:/media/LFS$ ./a.out
jack and jill went upto hill

lfs@boss:/media/LFS$


For your information, /media/LFS is the partition which I used to mount it during LFS building process...

My query, whether is that safe to build LFS under this scenario...using much more 'sudos'?

-Audhil
 
Old 03-05-2013, 05:06 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by smdaudhilbe View Post
But the problem is I need to enter sudo each and every time, even for a simple task as follows,

lfs@boss:/media/LFS$ sudo vim dummy.c
lfs@boss:/media/LFS$ gcc dummy.c
/usr/bin/ld: cannot open output file a.out: Permission denied
collect2: ld returned 1 exit status
lfs@boss:/media/LFS$ sudo gcc dummy.c
lfs@boss:/media/LFS$ ./a.out
jack and jill went upto hill

lfs@boss:/media/LFS$
Once you become user lfs (end of chapter 4.3) the root user isn't used/needed. This lasts up to and including chapter 5.33.

All the other commands in the book must be done as root user.

I've already told you multiple times that you should NOT use sudo. If you still want to use sudo to build LFS then every command (except from 4.3 to 5.33) must be done using sudo <command> (or sudo su -).

BTW: good luck with that.....

Last edited by druuna; 03-05-2013 at 05:27 AM.
 
Old 03-05-2013, 05:22 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
@smdaudhilbe:
Quote:
As per druuna's advice if I become root using su - command, if I may do anything wrong will cause me severe damage...For the sake of security I created (as per the direction given in LFS) a new user lfs to avoid such situations...
The above doesn't hold any ground.

Warning: DO NOT TRY OUT THE BELOW EXAMPLE COMMANDS !!!!

The following command will do the same thing (and are as dangerous):
Code:
su -
rm -rf /
or
Code:
sudo rm -rf /
Warning: DO NOT TRY OUT THE ABVOE EXAMPLE COMMANDS !!!!


In most cases you do not want to be working as root user and using sudo to do the occasional command that needs root permissions is seen as a good thing, building LFS isn't one of those cases.
 
Old 03-05-2013, 05:33 AM   #13
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Hi

can you post the oitput ls -l mnt/lfs
 
  


Reply

Tags
build, error, file, lfs, mkdir, sudo, sudoers


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
LFS 6.4 (Stable LFS) - error: "No such file or directory", linuxiso Linux - Newbie 1 08-03-2009 10:55 PM
LFS newbie stuck in Linux API headers step 5.5 LFS book 6.3 Vxplus Linux From Scratch 2 11-10-2008 08:13 PM
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM


All times are GMT -5. The time now is 07:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration