- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Remote modification of sudo file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 01:29 AM
тАО07-21-2006 01:29 AM
Remote modification of sudo file
As user jimmy leaves our organisation i want to remove him from all the server's sudoers file to keep it updated.
I have made this script which i want to be run remotely but it doesn't allow me to save the changes though it does the change and displays on the screen.If I use it on the server locally it works well
VALUE=" "
for i in $(cat serverlist)
do
ssh $i /usr/local/bin/sudo su - root -c \" sed '/jimmy,/s//"$VALUE"/g' /etc/sudoers > /tmp/sudoers; mv /tmp/sudoers /etc \"
done
ERROR::On running it remotely
stty: : Not a typewriter
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter
mv: when moving multiple files, last argument must be a directory
Thanks for all ur efforts
Rgds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 01:42 AM
тАО07-21-2006 01:42 AM
Re: Remote modification of sudo file
Your remote user has no environment, no TERM variable, no .profile, no nothing. If you choose to update this way instead of merely distributing a sudoers file, thats fine, but all you need to make this work is a /etc/profile a .profile and a few variables and stty settings set.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 01:54 AM
тАО07-21-2006 01:54 AM
Re: Remote modification of sudo file
Better yet, get yourself an autonomous agent:
http://www.cfengine.org/
Here are some of the primitives which can be automated:
Check and configure the network interface.
Edit textfiles.
Make and maintain symbolic links, including multiple links from a single command.
Check and set the permissions and ownership of files.
Tidy (delete) junk files which clutter the system.
Systematic, automated mounting of filesystems (Unix).
Checking for the presence of important files and filesystems.
Controlled execution of user scripts and shell commands.
Cfengine follows a class-based decision structure.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 02:04 AM
тАО07-21-2006 02:04 AM
Re: Remote modification of sudo file
Please take into account that it's not enough to edit /etc/sudoers file in order to use sudo. sudo uses a binary file which is created when you use visudo.
In iaby case it's much easier to copy /etc/sudoers to your master server, edit it there and copy back to the target.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 03:25 AM
тАО07-21-2006 03:25 AM
Re: Remote modification of sudo file
Will allow you to keep a master copy on a master server (or a central server or a repository server) and then propagate the changed file to the other servers. The sudoers file is a good candidate because you can configure various hosts into a single sudoers file and thereby only have 1 sudoers file for all of your systems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 04:24 AM
тАО07-21-2006 04:24 AM
Re: Remote modification of sudo file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2006 09:45 AM
тАО07-21-2006 09:45 AM
Re: Remote modification of sudo file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2006 11:08 PM
тАО08-01-2006 11:08 PM
Re: Remote modification of sudo file
Thanks to all for their time