LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-22-2015, 02:57 PM   #1
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Rep: Reputation: 18
trying to get rid of username prompt when using sudo in terminal


HI-

If I do :

my terminal prompt here: sudo -i

I get: [sudo] password for: [username]

That is not cool if I am going to paste my terminal code.
How can i get rid of [username] when it prompts me for sudo password?

I like to print screens of terminal sometimes when fooling with g++
and other stuff that require command line screen prints.

thanks,
mtdew3q
 
Old 02-22-2015, 04:07 PM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by mtdew3q View Post
If I do :

sudo -i

I get: [sudo] password for: [username]
which is perfectly normal.

Quote:
Originally Posted by mtdew3q View Post
That is not cool if I am going to paste my terminal code.
How can i get rid of [username] when it prompts me for sudo password?
You can't. But if you're going to paste that anyway, you can edit the user name in any way you like.

[X] Doc CPU
 
1 members found this post helpful.
Old 02-22-2015, 04:09 PM   #3
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
HI-

I found what I need. If I just use the -p switch for sudo as in the man page, I can supress my username. That is important because I don't want to broadcast my username to the world. I read an article about the advantages of using sudo to be root or having a separate root password. Then I saw the software hydra, and I figured it is time to obscure my username.

thanks,
mtdew3q
 
Old 02-22-2015, 05:35 PM   #4
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi -

in [.bashrc]
alias isudo='sudo -ip "enter password: "'
alias redux='sudo -p "enter password: " $(history -p !!)'
# redux repeats last regular command but this time using sudo
alias zsudo='sudo -p "enter password: " '
#usage = after typing alias zsudo [type command name] then password

http://www.reddit.com/r/ProgrammerHu...remains_alias/

http://askubuntu.com/questions/22037...hen-using-sudo

With some help from searching, I now have some cool sudo aliases.

thanks,
mtdew3q
 
  


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
[SOLVED] stuck at username prompt in Suse 12.2 myglide Linux - Newbie 4 03-12-2013 07:26 AM
sudo adduser [username] Howey Linux - Newbie 7 08-27-2011 08:29 AM
command used: sudo su - username sandeep002gupta General 2 07-05-2011 11:08 AM
How do I get rid of password prompt Aviynw Linux - Newbie 5 09-22-2007 03:47 PM
how to get rid of Password prompt in Samba? lu543285 Linux - Networking 1 01-09-2004 05:48 AM

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

All times are GMT -5. The time now is 09:47 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