[OpenIndiana-discuss] How to manage a send over ssh

Geoff Nordli geoffn at gnaa.net
Thu Mar 23 18:24:26 UTC 2017


On 2017-03-23 11:11 AM, Harry Putnam wrote:
> This is my first actual usage of send/receive.  I see the examples
> given here:
>
>       https://docs.oracle.com/cd/E18752_01/html/819-5461/gbchx.html#gbinw
>
>    host1# zfs send tank/dana at snap1 | ssh host2 zfs recv newtank/dana
>
> Note the `#' sign .. so root is sending, however in all of my installs,
> unless measures are taken to defeat the defaults, root cannot login to
> a solaris host.
>
> So using the formula above leads to the root passwd not being
> accepted.
>
> I attempted to insert the sudo command like so:
>
>     # zfs send tank/dana at snap1 | ssh USER at host2 sudo zfs recv newtank/dana
>
> But the sudo is rejected for lack of a tty.
>
> So how is this normally accomplished.  Does one have to setup a normal
> user in some way (I mean besides setting USER role=root) or steps
> taken with ssh like some kind of non passwd login?
>
>
> ___

Hi Harry.

A couple of different options:

1)  give your account zfs permissions (tank is the pool)

zfs allow -s  @adminrole 
clone,create,destroy,mount,promote,quota,receive,rename,reservation,rollback,send,snapshot,userprop 
tank
zfs allow harryp @adminrole tank


2)  use password less sudo for that use account.  In sudoers file add this:

harryp ALL = NOPASSWD: /usr/sbin/zfs


Have a great day!!

Geoff









More information about the openindiana-discuss mailing list