LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2015, 03:06 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 264

Rep: Reputation: 5
Debian sudo


How do I set my main user account to have sudo privlages?
 
Old 06-11-2015, 03:11 PM   #2
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
Code:
# gpasswd -a <user name> sudo
# newgrp sudo
https://wiki.debian.org/sudo

EDIT: You will need to run these commands with root privileges.

Rather than log in as root, you can use:
Code:
su -c 'gpasswd -a <user name> sudo && newgrp sudo'

Last edited by Head_on_a_Stick; 06-12-2015 at 02:37 AM.
 
1 members found this post helpful.
Old 06-11-2015, 03:11 PM   #3
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Add the user to the sudo group:

sudo
https://wiki.debian.org/sudo
 
2 members found this post helpful.
Old 06-11-2015, 08:49 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,866
Blog Entries: 18

Rep: Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340
You can add your user to sudoers as described above.

Debian does not set up sudo by default. Most distros, other than Ubuntu and its clones, do not share Ubuntu's sudo fetish.

Use su.
 
1 members found this post helpful.
Old 06-12-2015, 01:52 PM   #5
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by frankbell View Post
Debian does not set up sudo by default. Most distros, other than Ubuntu and its clones, do not share Ubuntu's sudo fetish.
The whole Ubunutu sudo thing I think is to focus on the European market compared to the American market. Not so well known in America, a lot of the European IT companies slap an admins hand for using the root user directly and prefer best practices to "sudo su" all the commands instead. Not saying I agree or disagree with it, just noting the different expectations of company policies of Europe verse America.
 
1 members found this post helpful.
Old 06-12-2015, 02:21 PM   #6
floppy_stuttgart
Member
 
Registered: Nov 2010
Location: Stuttgart, Germany
Distribution: Debian like
Posts: 795
Blog Entries: 2

Rep: Reputation: 75
Or: open a "root windows" if you see one in the applications. You can open that windows from any user. Then you have to give the root password.. and you are in it.
 
1 members found this post helpful.
Old 06-17-2015, 12:31 PM   #7
Garrett85
Member
 
Registered: Jan 2011
Posts: 264

Original Poster
Rep: Reputation: 5
Thanks all. If I plug my server up to the internet directly or through port forwarding I've read that I should have signing in under root via SSH turned off. If that's the case would making my primary username a sudo user be a security risk while making the SSH security measure irrelevant because now intuders wouldn't be able to log in under root but they would be able to log in directly under my username which would have the same privileges. Thanks again.
 
Old 06-17-2015, 01:11 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,910

Rep: Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999
I love that question. If I wasn't on my phone I would likely type an essay contradicting itself. I would say it's better than having root exposed but, also, if you're going to be opening SSH to the internet then use public keys if you possibly can, for security, and change the port to a non-standard high port, for your sanity when you start looking at logs for hacking attempts.
 
Old 06-17-2015, 09:21 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,175

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
I don't get that regional deal.

I'd think that one should limit access to root privileges. The use of sudo is a possible means to prevent various applications and services from starting unregulated.
 
Old 06-17-2015, 09:47 PM   #10
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
Garrett85,
why change it(privalages) now? Have you not already exchanged keys?

Fred.
 
  


Reply


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
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
[SOLVED] ubuntu-like sudo in Debian? nokangaroo Debian 8 03-12-2011 07:17 PM
Debian, swfdec, codecs, sudo b1f30 Debian 1 02-19-2009 06:31 PM
Debian, kdm config as sudo b1f30 Linux - Desktop 4 12-16-2008 02:49 PM
just can execute kppp via sudo or su in debian etch htamayo Linux - Newbie 2 06-27-2008 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:00 PM.

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