Fedora Linux Support Community & Resources Center
Prev Previous Post   Next Post Next
Old 3rd August 2017, 07:48 PM
lsatenstein Offline
Registered User
Join Date: Jun 2005
Location: Montreal, Que, Canada
Posts: 4,354
Is there a way to add alias's to sudo ?

Fedora's default list of alias's for /root are
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mc='. /usr/libexec/mc/mc-wrapper.sh'
alias mv='mv -i'
alias rm='rm -i'
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'

I added the above to my ~./bashrc and verified that they were enforced. I did that as I thought they were useful

However, when I run sudo cp a b
and then redo sudo cp a b

the alias's are not inspected or evaluated. In otherwords, the protection for accidental over-write are not enforced.

Is there a way to enforce same with sudo?
Leslie in Montreal

Interesting web sites list
Reply With Quote

add , alias , sudo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sudo NOPASSWD to .bashrc alias? Bazu135 Security and Privacy 6 3rd September 2011 09:31 AM
Cannot open /var/db/sudo after sudo package upgrade Replicant10000 Security and Privacy 1 16th September 2010 01:25 PM
How to Change Firefox Alias or any Alias? FergatROn Using Fedora 1 3rd June 2008 09:18 PM
alias help madjac Using Fedora 0 5th May 2007 09:44 PM
sudo question (host alias) arc2v Using Fedora 2 23rd June 2005 01:37 PM

Current GMT-time: 08:20 (Sunday, 22-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat