LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-10-2009, 04:33 PM   #1
kinkle
LQ Newbie
 
Registered: Mar 2009
Location: MN
Distribution: Debian squeeze
Posts: 13

Rep: Reputation: 3
using umask with sudo causes error


Code:
sudo -u someuser umask 003
outputs this error:

Quote:
sudo: umask: command not found
But if I do:
Code:
su someuser
password
umask 003
Then, everything works out.

Any ideas why sudo won't work with umask? (It works with other commands)
 
Old 04-10-2009, 04:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
umask is not a command, but a built-in function of bash. When you run sudo it doesn't spawn a shell, just executes the command directly, so without bash there, umask doesn't exist. umask isn't persistent though, so if that did work it'd set it and then instantly wipe out the change.
 
  


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 On
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
sudo error mouse46 Ubuntu 7 03-07-2009 06:20 AM
Error message while trying to install Sudo chigozie Solaris / OpenSolaris 2 01-23-2007 08:22 AM
Sudo User Error ! LinuxRam Linux - Security 6 08-28-2004 10:03 PM
sudo gethostbyname() error angustia Debian 2 03-26-2004 08:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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