- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Running sudo on remote machine question
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
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
тАО11-23-2008 02:29 AM
тАО11-23-2008 02:29 AM
I'm running a command on remote machine via "sudo". Why /tmp/kkk isn't created under root?
root@linux1 ~]# ssh -t vitaly@server sudo 'id; date >/tmp/kkk;ls -l /tmp/kkk'
uid=0(root) gid=0(root) groups=0(root)
-rw-r--r-- 1 vitaly vitaly 29 Nov 23 12:23 /tmp/kkk
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2008 11:10 AM
тАО11-23-2008 11:10 AM
Re: Running sudo on remote machine question
I assume it works if you put the 'id ...' in a script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2008 02:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2008 06:49 PM
тАО11-23-2008 06:49 PM
Re: Running sudo on remote machine question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 12:13 AM
тАО11-24-2008 12:13 AM
Re: Running sudo on remote machine question
But, in fact, I created this three-command example just for debugging my problem - my original command was just
ssh -t vitaly@server sudo 'date >/tmp/kkk'
what is the problem here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 04:27 AM
тАО11-24-2008 04:27 AM
Re: Running sudo on remote machine question
To make a usage listing of the directories in the /home partition.
Note that this runs the commands in a sub-shell to make the cd and file redirection work.
sudo sh -c "ls > /tmp/ls.out"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 04:52 AM
тАО11-24-2008 04:52 AM
Re: Running sudo on remote machine question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2008 04:53 AM
тАО11-24-2008 04:53 AM