LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-07-2012, 07:23 AM   #1
david0321
Member
 
Registered: Dec 2002
Posts: 32

Rep: Reputation: 0
Not able to use sudo from command line?


I have a new install of debian command line only. No GUI. I'm trying to open pico or vi with the sudo command to edit a file. I'm not able to use the sudo command. Not sure why?

Also am not able to log in as root. I'm guessing that root login has been disabled.

Thanks
 
Old 07-07-2012, 08:06 AM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
I'm not able to use the sudo command.
su is not enabled as default. Users must be added to the su group.
Code:
adduser <name> sudo
Quote:
Also am not able to log in as root.
Is it possible there is a difference between the password in your head (what it should be) and what you entered when installing? In other words, could you have made a mistake when entering the original password?

Last edited by Randicus Draco Albus; 07-07-2012 at 08:07 AM.
 
Old 07-07-2012, 08:15 AM   #3
david0321
Member
 
Registered: Dec 2002
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Randicus Draco Albus View Post
su is not enabled as default. Users must be added to the su group.
Code:
adduser <name> sudo

Is it possible there is a difference between the password in your head (what it should be) and what you entered when installing? In other words, could you have made a mistake when entering the original password?
Yes possible. Begining to wonder myself if I have the correct password.

Also there should be a sudoers file /etc/sudoers. This is where the user name is added. My install does not have this file. Not sure if I should create the file or what.

I tried adduser <name> sudo that did not work. adduser command not found.

Thanks
 
Old 07-07-2012, 09:15 AM   #4
david0321
Member
 
Registered: Dec 2002
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by david0321 View Post
Yes possible. Begining to wonder myself if I have the correct password.

Also there should be a sudoers file /etc/sudoers. This is where the user name is added. My install does not have this file. Not sure if I should create the file or what.

I tried adduser <name> sudo that did not work. adduser command not found.

Thanks
sudo did not install as default. Had to login as root use apt-get to install it. Then used the command adduser <name> sudo and that worked ok. By the way I was using the wrong password for root. Figured it out. Me bad.
 
Old 07-07-2012, 09:47 AM   #5
jheaton5
Member
 
Registered: Dec 2008
Posts: 33

Rep: Reputation: 16
sudo is not the standard way to use root permissions in Debian and so it is not set up automatically on a fresh install. In Debian the standard way to use root permissions is 'su'. su is set up automatically on a fresh install.

Randicus, your instructions are confusing since you typed su instead of sudo.
 
Old 07-07-2012, 11:08 AM   #6
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,886
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
use su not sudo

$ su
Password:
root@debian:/home/craig#

then you can use nano or whichever text editor you prefer.

As for logging into the GUI as root search the forum.

If you prefer sudo see:
sudo - Debian Wiki : http://wiki.debian.org/sudo

Randicus, you are confusing sudo and su, there is no su group.


$ groups
craig lp cdrom floppy sudo audio dip video plugdev users netdev lpadmin powerdev scanner debian-tor

to open a GUI app as root you can use either gksu or kdesu.
 
Old 07-07-2012, 06:51 PM   #7
david0321
Member
 
Registered: Dec 2002
Posts: 32

Original Poster
Rep: Reputation: 0
Thanks for the help all. I use OS X which makes use of sudo. So it is comfortable for me.
 
Old 07-08-2012, 12:19 PM   #8
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You want to use sudo, then you need to read the manual

Code:
$ man sudo
Also:

https://wiki.debian.org/sudo
http://www.debianhelp.co.uk/sudo.htm
http://www.debianadmin.com/providing...sing-sudo.html

You could also have set up to use sudo at install time.
 
  


Reply



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
sudo cd /root gives 'sudo: cd: command not found'. stf92 Linux - Newbie 4 03-03-2012 09:05 AM
[SOLVED] problem with sudo and command line mchoquette Linux - Newbie 1 03-31-2011 10:06 AM
(Sudo) command can't run by sudo rahilmaknojia Linux - Server 8 06-25-2010 09:30 AM
/usr/sbin/sudo: line 1: root: command not found saheelahamed Linux - Software 2 08-02-2007 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:23 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
Open Source Consulting | Domain Registration