Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACKUP_URL=cifs not piping the credentials #1198

Closed
do-d1 opened this issue Feb 12, 2017 · 14 comments
Closed

BACKUP_URL=cifs not piping the credentials #1198

do-d1 opened this issue Feb 12, 2017 · 14 comments

Comments

@do-d1
Copy link

do-d1 commented Feb 12, 2017

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
Copy link
Member

gozora commented Feb 12, 2017

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
Copy link
Author

do-d1 commented Feb 12, 2017 via email

@gozora
Copy link
Member

gozora commented Feb 12, 2017

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
Copy link
Author

do-d1 commented Feb 12, 2017 via email

@gozora
Copy link
Member

gozora commented Feb 12, 2017

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
Copy link
Author

do-d1 commented Feb 13, 2017 via email

@gdha
Copy link
Member

gdha commented Feb 13, 2017

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

@do-d1
Copy link
Author

do-d1 commented Feb 13, 2017 via email

@gozora
Copy link
Member

gozora commented Feb 13, 2017

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
Copy link
Member

gdha commented Feb 14, 2017

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

@gdha
Copy link
Member

gdha commented Mar 1, 2017

@do-d1 can this issue be closed?

@jsmeix
Copy link
Member

jsmeix commented Jul 18, 2018

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

@jsmeix jsmeix closed this as completed Jul 18, 2018
@saviodsouza
Copy link

saviodsouza commented Mar 13, 2019

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
Copy link
Member

jsmeix commented Mar 13, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants