LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 02:06 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Rep: Reputation: 6
Debian sudo


How do I set my main user account to have sudo privlages?
 
Old 06-11-2015, 02:11 PM   #2
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
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 01:37 AM.
 
1 members found this post helpful.
Old 06-11-2015, 02: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, 07:49 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
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, 12: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, 01:21 PM   #6
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
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, 11:31 AM   #7
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Original Poster
Rep: Reputation: 6
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, 12:11 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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, 08:21 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,996

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
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, 08:47 PM   #10
Fred Caro
Senior Member
 
Registered: May 2007
Posts: 1,007

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

Fred.
 
  


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

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

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