* [gentoo-user] Problem with sudo
@ 2012-06-30 17:27 赵佳晖
2012-06-30 17:34 ` Alecks Gates
2012-06-30 18:48 ` Neil Bothwick
0 siblings, 2 replies; 11+ messages in thread
From: 赵佳晖 @ 2012-06-30 17:27 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
In some cases , when i run somethings with "sudo" , it tells me "Permission
Denied" , then i should turn to root . i forgot to record the cases . Did
anyone have any ideas ?
--
好好学习,天天向上!!!
[-- Attachment #2: Type: text/html, Size: 269 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-06-30 17:27 [gentoo-user] Problem with sudo 赵佳晖
@ 2012-06-30 17:34 ` Alecks Gates
2012-07-01 2:36 ` 赵佳晖
2012-06-30 18:48 ` Neil Bothwick
1 sibling, 1 reply; 11+ messages in thread
From: Alecks Gates @ 2012-06-30 17:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
On Jun 30, 2012 12:28 PM, "赵佳晖" <jiahui.tar.gz@gmail.com> wrote:
>
> In some cases , when i run somethings with "sudo" , it tells me
"Permission Denied" , then i should turn to root . i forgot to record the
cases . Did anyone have any ideas ?
>
> --
> 好好学习,天天向上!!!
I think it would depend on the use case, but try "sudo -i" (-i meaning
interactive, I believe) and see if that works for you. I get permission
denied usually with a lot of bash input and output.
Alecks Gates, sent from Android on an HTC G2
[-- Attachment #2: Type: text/html, Size: 685 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-06-30 17:34 ` Alecks Gates
@ 2012-07-01 2:36 ` 赵佳晖
2012-07-01 2:55 ` Alecks Gates
0 siblings, 1 reply; 11+ messages in thread
From: 赵佳晖 @ 2012-07-01 2:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
The -i option didn't work, it also says Permission Denied
2012/7/1 Alecks Gates <alecks.g@gmail.com>
> On Jun 30, 2012 12:28 PM, "赵佳晖" <jiahui.tar.gz@gmail.com> wrote:
> >
> > In some cases , when i run somethings with "sudo" , it tells me
> "Permission Denied" , then i should turn to root . i forgot to record the
> cases . Did anyone have any ideas ?
> >
> > --
> > 好好学习,天天向上!!!
> I think it would depend on the use case, but try "sudo -i" (-i meaning
> interactive, I believe) and see if that works for you. I get permission
> denied usually with a lot of bash input and output.
>
> Alecks Gates, sent from Android on an HTC G2
>
--
好好学习,天天向上!!!
[-- Attachment #2: Type: text/html, Size: 1163 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-07-01 2:36 ` 赵佳晖
@ 2012-07-01 2:55 ` Alecks Gates
2012-07-01 5:06 ` 赵佳晖
2012-07-01 8:03 ` Neil Bothwick
0 siblings, 2 replies; 11+ messages in thread
From: Alecks Gates @ 2012-07-01 2:55 UTC (permalink / raw
To: gentoo-user
On Sat, Jun 30, 2012 at 9:36 PM, 赵佳晖 <jiahui.tar.gz@gmail.com> wrote:
> The -i option didn't work, it also says Permission Denied
>
>
> 2012/7/1 Alecks Gates <alecks.g@gmail.com>
>>
>> On Jun 30, 2012 12:28 PM, "赵佳晖" <jiahui.tar.gz@gmail.com> wrote:
>> >
>> > In some cases , when i run somethings with "sudo" , it tells me
>> > "Permission Denied" , then i should turn to root . i forgot to record the
>> > cases . Did anyone have any ideas ?
>> >
>> > --
>> > 好好学习,天天向上!!!
>> I think it would depend on the use case, but try "sudo -i" (-i meaning
>> interactive, I believe) and see if that works for you. I get permission
>> denied usually with a lot of bash input and output.
>>
>> Alecks Gates, sent from Android on an HTC G2
>
>
>
>
> --
> 好好学习,天天向上!!!
Did you use it interactively? It should look like this:
alecks@linux:~$ sudo -i
root@linux: ~# echo "sys-boot/grub:2 **" >>
/etc/portage/package.accept_keywords/package.keywords.grub2
Just the way I like to do it. You could also do something like "sudo
su" and I'm sure someone else here will have all sorts of
alternatives. Just like I'm sure someone has a way to do it all in
one line, anyway.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-07-01 2:55 ` Alecks Gates
@ 2012-07-01 5:06 ` 赵佳晖
2012-07-01 8:03 ` Neil Bothwick
1 sibling, 0 replies; 11+ messages in thread
From: 赵佳晖 @ 2012-07-01 5:06 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]
hmm...yes , i want to do it in one command line..
2012/7/1 Alecks Gates <alecks.g@gmail.com>
> On Sat, Jun 30, 2012 at 9:36 PM, 赵佳晖 <jiahui.tar.gz@gmail.com> wrote:
> > The -i option didn't work, it also says Permission Denied
> >
> >
> > 2012/7/1 Alecks Gates <alecks.g@gmail.com>
> >>
> >> On Jun 30, 2012 12:28 PM, "赵佳晖" <jiahui.tar.gz@gmail.com> wrote:
> >> >
> >> > In some cases , when i run somethings with "sudo" , it tells me
> >> > "Permission Denied" , then i should turn to root . i forgot to record
> the
> >> > cases . Did anyone have any ideas ?
> >> >
> >> > --
> >> > 好好学习,天天向上!!!
> >> I think it would depend on the use case, but try "sudo -i" (-i meaning
> >> interactive, I believe) and see if that works for you. I get permission
> >> denied usually with a lot of bash input and output.
> >>
> >> Alecks Gates, sent from Android on an HTC G2
> >
> >
> >
> >
> > --
> > 好好学习,天天向上!!!
> Did you use it interactively? It should look like this:
> alecks@linux:~$ sudo -i
> root@linux: ~# echo "sys-boot/grub:2 **" >>
> /etc/portage/package.accept_keywords/package.keywords.grub2
>
> Just the way I like to do it. You could also do something like "sudo
> su" and I'm sure someone else here will have all sorts of
> alternatives. Just like I'm sure someone has a way to do it all in
> one line, anyway.
>
>
--
好好学习,天天向上!!!
[-- Attachment #2: Type: text/html, Size: 2208 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-07-01 2:55 ` Alecks Gates
2012-07-01 5:06 ` 赵佳晖
@ 2012-07-01 8:03 ` Neil Bothwick
1 sibling, 0 replies; 11+ messages in thread
From: Neil Bothwick @ 2012-07-01 8:03 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 732 bytes --]
On Sat, 30 Jun 2012 21:55:27 -0500, Alecks Gates wrote:
> Did you use it interactively? It should look like this:
> alecks@linux:~$ sudo -i
> root@linux: ~# echo "sys-boot/grub:2 **" >>
> /etc/portage/package.accept_keywords/package.keywords.grub2
>
> Just the way I like to do it. You could also do something like "sudo
> su" and I'm sure someone else here will have all sorts of
> alternatives.
sudo -i
sudo su
sudo bash
sudo zsh
sudo screen
sudo tmux
There are plenty of ways to get a root shell with sudo.
> Just like I'm sure someone has a way to do it all in
> one line, anyway.
echo "some text" | sudo tee /some/file
--
Neil Bothwick
Disinformation is not as good as datinformation.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-06-30 17:27 [gentoo-user] Problem with sudo 赵佳晖
2012-06-30 17:34 ` Alecks Gates
@ 2012-06-30 18:48 ` Neil Bothwick
2012-06-30 19:22 ` Éric DUNAND
1 sibling, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2012-06-30 18:48 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
On Sun, 1 Jul 2012 01:27:49 +0800, 赵佳晖 wrote:
> In some cases , when i run somethings with "sudo" , it tells me
> "Permission Denied" , then i should turn to root . i forgot to record
> the cases . Did anyone have any ideas ?
Are you trying to redirect the output? That can give this message because
the redirection is performed as the user running sudo, not as root.
--
Neil Bothwick
Man and mouse are alike, both end up in pussy :)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-06-30 18:48 ` Neil Bothwick
@ 2012-06-30 19:22 ` Éric DUNAND
2012-07-01 2:41 ` 赵佳晖
0 siblings, 1 reply; 11+ messages in thread
From: Éric DUNAND @ 2012-06-30 19:22 UTC (permalink / raw
To: gentoo-user
Le Sat, 30 Jun 2012 19:48:28 +0100,
Neil Bothwick <neil@digimed.co.uk> a écrit :
> On Sun, 1 Jul 2012 01:27:49 +0800, 赵佳晖 wrote:
>
> > In some cases , when i run somethings with "sudo" , it tells me
> > "Permission Denied" , then i should turn to root . i forgot to
> > record the cases . Did anyone have any ideas ?
>
> Are you trying to redirect the output? That can give this message
> because the redirection is performed as the user running sudo, not as
> root.
>
>
If Neil is right, you may want to read man tee. It work roughly like
that:
instead of do
sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg
sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg
--
Éric DUNAND
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-06-30 19:22 ` Éric DUNAND
@ 2012-07-01 2:41 ` 赵佳晖
2012-07-03 12:50 ` Willie WY Wong
0 siblings, 1 reply; 11+ messages in thread
From: 赵佳晖 @ 2012-07-01 2:41 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
I have use your method , it didn't work .
Like:
sudo echo "sys-boot/grub:2 **" >>
/etc/portage/package.accept_keywords/package.keywords.grub2 echo
"sys-boot/grub:2 **" | sudo tee
/etc/portage/package.accept_keywords/package.keywords.grub2
And the result :
zjhui@gentoo ~ $ ls -l
/etc/portage/package.accept_keywords/package.keywords.grub2
-rw-r--r-- 1 root root 0 Jul 1 10:37
/etc/portage/package.accept_keywords/package.keywords.grub2
It's an empty file.
2012/7/1 Éric DUNAND <eric.dunand.ml@eriknet.eu>
> Le Sat, 30 Jun 2012 19:48:28 +0100,
> Neil Bothwick <neil@digimed.co.uk> a écrit :
>
> > On Sun, 1 Jul 2012 01:27:49 +0800, 赵佳晖 wrote:
> >
> > > In some cases , when i run somethings with "sudo" , it tells me
> > > "Permission Denied" , then i should turn to root . i forgot to
> > > record the cases . Did anyone have any ideas ?
> >
> > Are you trying to redirect the output? That can give this message
> > because the redirection is performed as the user running sudo, not as
> > root.
> >
> >
>
> If Neil is right, you may want to read man tee. It work roughly like
> that:
> instead of do
> sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg
> sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg
> --
> Éric DUNAND
>
>
--
好好学习,天天向上!!!
[-- Attachment #2: Type: text/html, Size: 2064 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-07-01 2:41 ` 赵佳晖
@ 2012-07-03 12:50 ` Willie WY Wong
2012-07-04 0:39 ` 赵佳晖
0 siblings, 1 reply; 11+ messages in thread
From: Willie WY Wong @ 2012-07-03 12:50 UTC (permalink / raw
To: gentoo-user
On Sun, Jul 01, 2012 at 10:41:12AM +0800, Penguin Lover 赵佳晖 squawked:
> I have use your method , it didn't work .
> Like:
> sudo echo "sys-boot/grub:2 **" >>
> /etc/portage/package.accept_keywords/package.keywords.grub2 echo
> "sys-boot/grub:2 **" | sudo tee
> /etc/portage/package.accept_keywords/package.keywords.grub2
>
> And the result :
> zjhui@gentoo ~ $ ls -l
> /etc/portage/package.accept_keywords/package.keywords.grub2
> -rw-r--r-- 1 root root 0 Jul 1 10:37
> /etc/portage/package.accept_keywords/package.keywords.grub2
>
> It's an empty file.
I think you misread the e-mail. The left hand side below is what you
**shouldn't** do. The right hand side is what you **should** do. So
you **should** run
echo "sys-boot/grub:2 **" | sudo tee /etc/portage/package.accept_keywords/package.keywords.grub2
and no more.
W
>
> > If Neil is right, you may want to read man tee. It work roughly like
> > that:
> > instead of do
> > sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg
> > sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Problem with sudo
2012-07-03 12:50 ` Willie WY Wong
@ 2012-07-04 0:39 ` 赵佳晖
0 siblings, 0 replies; 11+ messages in thread
From: 赵佳晖 @ 2012-07-04 0:39 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]
Oh,yes , i misunderstand it . Thank you
2012/7/3 Willie WY Wong <wongwwy@member.ams.org>
> On Sun, Jul 01, 2012 at 10:41:12AM +0800, Penguin Lover 赵佳晖 squawked:
> > I have use your method , it didn't work .
> > Like:
> > sudo echo "sys-boot/grub:2 **" >>
> > /etc/portage/package.accept_keywords/package.keywords.grub2 echo
> > "sys-boot/grub:2 **" | sudo tee
> > /etc/portage/package.accept_keywords/package.keywords.grub2
> >
> > And the result :
> > zjhui@gentoo ~ $ ls -l
> > /etc/portage/package.accept_keywords/package.keywords.grub2
> > -rw-r--r-- 1 root root 0 Jul 1 10:37
> > /etc/portage/package.accept_keywords/package.keywords.grub2
> >
> > It's an empty file.
>
> I think you misread the e-mail. The left hand side below is what you
> **shouldn't** do. The right hand side is what you **should** do. So
> you **should** run
>
> echo "sys-boot/grub:2 **" | sudo tee
> /etc/portage/package.accept_keywords/package.keywords.grub2
>
> and no more.
>
> W
>
> >
> > > If Neil is right, you may want to read man tee. It work roughly like
> > > that:
> > > instead of do
> > > sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg
> > > sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg
>
>
>
--
好好学习,天天向上!!!
[-- Attachment #2: Type: text/html, Size: 1977 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-07-04 0:40 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-30 17:27 [gentoo-user] Problem with sudo 赵佳晖
2012-06-30 17:34 ` Alecks Gates
2012-07-01 2:36 ` 赵佳晖
2012-07-01 2:55 ` Alecks Gates
2012-07-01 5:06 ` 赵佳晖
2012-07-01 8:03 ` Neil Bothwick
2012-06-30 18:48 ` Neil Bothwick
2012-06-30 19:22 ` Éric DUNAND
2012-07-01 2:41 ` 赵佳晖
2012-07-03 12:50 ` Willie WY Wong
2012-07-04 0:39 ` 赵佳晖
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox