#1198 Issue closed: BACKUP_URL=cifs not piping the credentials

Labels: support / question, fixed / solved / done

do-d1 opened issue at 2017-02-12 11:34:

Relax-and-Recover (rear) Issue Template

Please fill in the following items before submitting a new issue (quick response is not guaranteed with free support):

  • rear version (/usr/sbin/rear -V):
    Relax-and-Recover 1.17.2 / Git

  • OS version (cat /etc/rear/os.conf or lsb_release -a):
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.1 LTS
    Release: 14.04
    Codename: trusty

  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    OUTPUT=ISO
    BACKUP=NETFS
    BACKUP_URL=cifs://x.x.x.x/testshare
    BACKUP_OPTIONS="cred=/etc/rear/cifs"

  • Are you using legacy BIOS or UEFI boot?
    BIOS

  • Brief description of the issue:
    when using cifs the credentials are not piped

Using log file: /var/log/rear/rear-ubuntu.log
ERROR: Mount command 'mount -v -o cred=/etc/rear/cifs //x.x.x.x/testshare /tmp/rear.1yl84AP9bHuGSqP/outputfs' failed.
Aborting due to an error, check /var/log/rear/rear-ubuntu.log for details
Terminated

dmesg:
[246018.008600] CIFS VFS: No username specified

  • Work-around, if any:

gozora commented at 2017-02-12 11:43:

Hi @do-d1,

May I assume your /etc/rear/cifs looks something like:

# cat /etc/rear/cifs
username=_username_
password=_secret password_
domain=_domain_

?

V.

do-d1 commented at 2017-02-12 11:46:

yes it is
changed username with my username ..

On Sun, Feb 12, 2017 at 1:43 PM, Vladimir Gozora notifications@github.com
wrote:

Hi @do-d1 https://github.com/do-d1,

May I assume your /etc/rear/cifs looks something like:

cat /etc/rear/cifs

username=username
password=secret password
domain=domain

?

V.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1198#issuecomment-279212838, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANcS5nifMK_ZA-xW_Bdl583IUc-u2Fhaks5rbvBTgaJpZM4L-div
.

gozora commented at 2017-02-12 11:50:

Interesting,
Honestly I'm not using Samba much, but I'll try to reproduce it and see what can be wrong.
One more question though, do you have some specific reason for using ReaR 1.17 ?
Could you maybe test with ReaR 2.0?

V.

do-d1 commented at 2017-02-12 12:18:

no special reason, i was thinking 1.7 is the latest version ..
ill give a try for ReaR 2.0 and will update the results

On Sun, Feb 12, 2017 at 1:50 PM, Vladimir Gozora notifications@github.com
wrote:

Interesting,
Honestly I'm not using Samba much, but I'll try to reproduce it and see
what can be wrong.
One more question though, do you have some specific reason for using ReaR
1.17 ?
Could you maybe test with ReaR 2.0?

V.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1198#issuecomment-279213207, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANcS5ru8q2oHmRkokH5UKrLH070uWUXQks5rbvH2gaJpZM4L-div
.

gozora commented at 2017-02-12 17:42:

Hello @do-d1

I just finished backup of my Ubuntu 14.4 to samba back end.
For me, it just worked.
I've used following configuration (quite similar to yours):

ubuntu:(/root)(root)# cat /etc/rear/local.conf 
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=cifs://suse12/rear
BACKUP_OPTIONS="cred=/etc/rear/cifs"
BACKUP_PROG_EXCLUDE=( /media/* )

Samba setup like (more/less default):

suse12:~ # cat /etc/samba/smb.conf 
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
[global]
    workgroup = WORKGROUP
    passdb backend = tdbsam
    printing = cups
    printcap name = cups
    printcap cache time = 750
    cups options = raw
    map to guest = Bad User
    include = /etc/samba/dhcp.conf
    logon path = \\%L\profiles\.msprofile
    logon home = \\%L\%U\.9xprofile
    logon drive = P:
    usershare allow guests = Yes
[homes]
    comment = Home Directories
    valid users = %S, %D%w%S
    browseable = No
    read only = No
    inherit acls = Yes
[profiles]
    comment = Network Profiles Service
    path = %H
    read only = No
    store dos attributes = Yes
    create mask = 0600
    directory mask = 0700
[users]
    comment = All users
    path = /home
    read only = No
    inherit acls = Yes
    veto files = /aquota.user/groups/shares/
[groups]
    comment = All groups
    path = /home/groups
    read only = No
    inherit acls = Yes
[printers]
    comment = All Printers
    path = /var/tmp
    printable = Yes
    create mask = 0600
    browseable = No
[print$]
    comment = Printer Drivers
    path = /var/lib/samba/drivers
    write list = @ntadmin root
    force group = ntadmin
    create mask = 0664
    directory mask = 0775
[rear]
    comment = ReaR backup folder
    path = /mnt/rear
    valid users = sodoma
    read only = no

However, I had a small problem with missing mount.cifs binary on my Ubuntu, which was solved with apt-get install cifs-utils. After this all worked fine for me.

If you still have trouble, please re-run backup with rear -d -D mkbackup and post output log here. It should be more clear what is wrong, once we have whole session record.

V.

P.S. I've tested with Relax-and-Recover 1.17.2 / Git so I guess you don't need to upgrade. ;-).

do-d1 commented at 2017-02-13 12:30:

Dear Vladimir, thank you for your help

its Ubuntu server so samba wasn't installed , i installed it and it dident
solved the problem.
then i installed cifs-utils and now it works like a charm (:

so now i will bring up new server and make a new list of packages and
dependencies for offline install

thank you very much

On Sun, Feb 12, 2017 at 7:42 PM, Vladimir Gozora notifications@github.com
wrote:

Hello @do-d1 https://github.com/do-d1

I just finished backup of my Ubuntu 14.4 to samba back end.
For me, it just worked.
I've used following configuration (quite similar to yours):

ubuntu:(/root)(root)# cat /etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=cifs://suse12/rear
BACKUP_OPTIONS="cred=/etc/rear/cifs"
BACKUP_PROG_EXCLUDE=( /media/* )

Samba setup like (more/less default):

suse12:~ # cat /etc/samba/smb.conf

smb.conf is the main Samba configuration file. You find a full commented

version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the

samba-doc package is installed.

[global]
workgroup = WORKGROUP
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
[rear]
comment = ReaR backup folder
path = /mnt/rear
valid users = sodoma
read only = no

However, I had a small problem with missing mount.cifs binary on my
Ubuntu, which was solved with apt-get install cifs-utils. After this all
worked fine for me.

If you still have trouble, please re-run backup with rear -d -D mkbackup
and post output log here. It should be more clear what is wrong, once we
have whole session record.

V.

P.S. I've tested with Relax-and-Recover 1.17.2 / Git so I guess you
don't need to upgrade. ;-).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1198#issuecomment-279234706, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANcS5h1PkQsg9a1GZqIQVnI6_3c-MxE5ks5rb0SHgaJpZM4L-div
.

gdha commented at 2017-02-13 13:28:

@do-d1 I think it is a good idea to add some more comments in our example configuration files about package dependencies

do-d1 commented at 2017-02-13 15:56:

rear 1.19 & 2.0 depends on isolinux,
isolinux is available only for ubuntu 16.04 and up

my test system is ubuntu server 14.04 x64

dpkg -i ./rear_1.18_amd64.deb
dpkg: dependency problems prevent configuration of rear

apt-get update
apt-get install -f

this packages was installed:

attr binutils genisoimage iproute libcrypt-passwdmd5-perl mtools syslinux
syslinux-common

for cifs support i had to install cifs-utils
and this dependency's was also installed :

keyutils libavahi-client3 libavahi-common-data libavahi-common3 libcups2
libgmp10 libldb1 libtalloc2 libtdb1 libtevent0 libwbclient0 python-crypto
python-ldb python-samba python-talloc python-tdb samba-common
samba-common-bin samba-libs

cift works great

a feature i would like to see is an option to encrypt the cred=/etc/rear/cifs
file

On Mon, Feb 13, 2017 at 3:28 PM, gdha notifications@github.com wrote:

@do-d1 https://github.com/do-d1 I think it is a good idea to add some
more comments in our example configuration files about package dependencies


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/issues/1198#issuecomment-279391977, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANcS5oylHHS2bELtZJtTuaCwzJnZ_X80ks5rcFpugaJpZM4L-div
.

gozora commented at 2017-02-13 16:32:

hello @do-d1 ,

thank you very much

You are always welcome!

a feature i would like to see is an option to encrypt the cred=/etc/rear/cifs
file

In my opinion, encrypting credential file just lack sense, especially if you are using Samba which is not encrypted by default ...
If you'd like to increase security of your backups, you should go for BACKUP_URL=sshfs:// (which I never personally tryied) or BACKUP=BORG which uses ssh as transfer protocol (with Borg you will also get backup deduplication).
With these two methods you can take advantage of ssh keys functionality and basically lock your credentials.

For more info, please check ReaR documentation ,and some basic backup scenarios can be useful as well.

Hope it helps.

V.

gdha commented at 2017-02-14 08:16:

You can also use DUPLICITY as BACKUP method - security guaranteed.

gdha commented at 2017-03-01 19:20:

@do-d1 can this issue be closed?

jsmeix commented at 2018-07-18 10:31:

Because there are no further comments
I assume this isssue is sufficiently answered
so that I can close it hereby.

saviodsouza commented at 2019-03-13 03:55:

Hello I wanted to try rear with a Ubuntu server for the first time

# cat /etc/rear/cifs 
username=username
password=secret password
domain=domain.local

Is the above right or do I have to add the _ signs.
This sounds stupid but I am trying it for the first time.....

jsmeix commented at 2019-03-13 08:10:

@saviodsouza
this issue is closed.

For a new issue please open a new separated issue
and provide the information we need as described in
https://github.com/rear/rear/blob/master/.github/ISSUE_TEMPLATE.md
You get that template automatically when you use the [New issue] button on
https://github.com/rear/rear/issues

If you think your issue is related to this issue
you may add a URL to this issue in your issue.


[Export of Github issue for rear/rear.]