I have a shell script that mounts an smb share. It works perfectly on all macs with every OS revision except 10.7.5
The offending command is simply:
mount -t smbfs -o nobrowse //test:test#servername/sharename /my/mnt/point
When I attempt this command on a 10.7.5 mac, it fails either with a "broken pipe" or "authentication failed" error. However, it works fine on macs running 10.7.4, 10.6, 10.8 etc.
Can anyone successfully use this command on 10.7.5?
Is there any alternative way of achieving this, or troubleshooting exactly why this error is happening? I'm running out of ideas!
Since feature requests to mark a comment as an answer remain declined, I copy the above solution here.
Thanks for the replies. The problem was two fold: firstly, for some reason you cannot run this command as root in 10.7.5, and secondly you cannot mount outisde of /Volumes. Strangely this seems to work in all other OS revisions. I have worked around this problem by mounting my share in /Volumes and then creating a sym link to the desired mount point:
mkdir -p /Volumes/share
sudo -u localadminuser mount -t smbfs -o nobrowse //user:pass#server/share /Volumes/share
ln -s /Volumes/share /location/that/I/prefer/to/mnt
I hope this helps someone out. No idea why 10.7.5 changes this. – BSUK
There are many reasons why the mount will not work. Some of the reasons include:
Time between server and client being too different
Workgroup name not specified on the mac
Local hostname uses non-latin characters
Encryption is too strict between the mac and the server
To solve the time; set the time.
I've seen broken pipe/authentication errors most often when you don't use a workgroup name for the connection. A connection string looking like generally works better than one without any workgroup:
//WORKGROUP;user:50000#192.168.2.1/Share
... assuming that the 50000 is the password for the user user should allow the connection. Generally, you just need to have a string before the semi-colon, it can read anything; it just needs to be there.
To solve the local hostname issue click on an interface, choose advanced go to the WINS tab and make sure that the name doesn't have any foreign characters there.
If the encryption is too strict, you will need to edit the nsmb.conf. I have a set of lines looking like:
[server1]
minauth=none
for an ancient BSD server which cannot deal with encrypted passwords. You can have this in either an /etc/nsmb.conf or ~/Library/Preferences/nsmb.conf file.
This may not address your issue, but it may help you in trying to proceed.
Unfortunately, saying it works on box x and not on box y doesn't really help, as there could be any arbitrary configuration difference between them.
Related
broken mount point, as it seens in mc
I'm trying to mount my work servers to local folder.
"sudo sshfs webuser#rgslb.com:/var/www/webuser/data/www /Volumes/rgslb.com"
It asks me password and silently proceed. But as result I have broken file, in mc it looks like ?rgslb.com, but "ls -l" says that there no this file in /Volumes. And when I unmounted it this mount point directory disappear.
Have any one has same situation? Thank you.
I got simple solution, do sshfs... without sudo, to ~/rgslb.com. And it works.
I'm working on getting GIT installed so starting to use my terminal more.
Noticed something odd though. The word localhost:~ before my username
so localhost:~ username$
Is this something I need to be worried about? Just I'm following some tutorials and all of them so far just have the user name like
username$
Done a bit of searching and found nothing on this so far and just wanted to check before I move on any further.
Thanks
using osx 10.8.5
Nothing to worry about. localhost is the name of your machine, followed by :, followed by the directory you're in, in this case ~, which is your home directory.
I set the HOME variable in /etc/launchd.conf using the following line: setenv HOME /Users/student
Now the machine wont boot at startup. I tried holding shift at startup but safe mode doesn't seem to be working. I tried holding cmd+s on startup and got into single user mode. I was able to bring up the /etc/launchd.conf file but I can not save/overwrite the existing file due to permission issues.
Is there some way to reset this file from single user mode or other to fix this? I'm open to other approaches as well. I am not a unix/linux power user by any means, fyi :)
Thank you in advance.
I'll give you two options, but first a warning: both of these involve using the command line to undo the damage, and if you do it wrong there's a possibility you'll make it even worse. A backup would've been a good idea, but it's a little late for that (well, actually, there are still ways to do it, but they also involve a risk of getting it wrong...). So whatever your do, be careful.
Option 1: use single-user mode (Command-S at startup). This will leave you running as root, which means you are not subject to normal file permissions; after remounting the startup disk for write access (mount -uw /) you should not get permissions errors. You said this didn't work; the most likely thing is that you mistyped the command (I see this happen a lot -- people either leave out the "/", or the space between "-uw" and "/"). Hint: if the mount command prints anything (other than the prompt for the next command) you typed it wrong. If that still doesn't do it, check the file's flags and metadata with ls -leO# /etc/launchd.conf and report the results.
Option 2: use recovery mode (Command-R at startup). This boots from a small hidden partition with a minimal copy of OS X. In recovery mode, pull down the Utilities menu and choose Terminal. This is actually a fair bit like single-user mode, except that the normal startup disk won't be /, it'll be /Volumes/Macintosh HD (or whatever it's named), and it'll already be mounted for write access. Since there's (probably) a space in the volume name, you'll have to quote or escape it:
$ cd "/Volumes/Macintosh HD"
$ mv launchd.conf launchd.conf-disabled
I've got a Lacie Network Space 2 where they have disabled the SSH access and I'd like to write a script where I transfer files from my computer to the NS2 using scp.
The only problem I have is that I can't (from what I know) generate a public key without first connecting via SSH.
So my question is: Is it possible to generate a key without having access to SSH, for use with scp? Or some other clever way to transfer files to my NS2 (FW 2.2.4) using a script.
I might add that I'm currently mounting the disk and using cp, but I'd like something better.
Thanks in advance!
What exactly do you want? If you want to scp to the NS2, you'll have to generate the keys on the source machines and append it to authorized_keys on the target. Since you can already mount & use cp, you should be able to do that.
Note that since scp works over ssh, if they've disabled ssh this won't work. OTOH, if they've only disabled password based ssh, or set /bin/false as your shell, this might work.
I have concluded that if you want to gain access to ssh keys on your NS2 with a newer FW you have to remove the disk from its casing and connect it to a computer, as they explain in this link
Enabling SSH on NS2
I thank you both for your answers, but I guess I'll have to do it the hard way.
I am creating a bash script to backup my files with rsync.
Backups all come from a single directory.
I only want new or modified files to be backed up.
Currently, I am telling rsync to backup the dir, and to check the files compared to the last backup.
The way I am doing this is
THE_TIME=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -aP --link-dest=/Backup/Current /usr/home/user/backup /Backup/Backup-$THE_TIME
rm -f /Backup/Current
ln -s /Backup/Backup-$THE_TIME /Backup/Current
I am pretty sure I have the syntax correct for this. Each backup will check against the "Current" folder, and upload only as necesary. It will then delete the Current folder, and re-create the symlink to the newest backup it just did.
I am getting an error when I run the script:
rsync: link "/Backup/Backup-2010-08-04-12:21:15/dgs1200series_manual_310.pdf"
=> /Backup/Current/dgs1200series_manual_310.pdf
failed: Operation not supported (45)
The host OS is running HFS filesystem, which supports hard linking. I am trying to figure out if something else is not supporting this, or if I have a problem in my code.
Thanks for any help
Edit:
I am able to create a hard link on my local machine.
I am also able to create a hard link on the remote server (when logged in locally)
I am NOT able to create a hard link on the remote server when mounted via afp. Even if both files exist on the server.
I am guessing this is a limitation of afp.
Just in case your command line is only an example: Be sure to always specify the link-dest directory with an absolute pathname! That’s something which took me quite some time to figure out …
Two things from the man page stand out that are worth checking:
If file's aren't linking, double-check their attributes. Also
check if some attributes are getting forced outside of rsync's
control, such a mount option that squishes root to a single
user, or mounts a removable drive with generic ownership (such
as OS X's “Ignore ownership on this volume” option).
and
Note that rsync versions prior to 2.6.1 had a bug that could
prevent --link-dest from working properly for a non-super-user
when -o was specified (or implied by -a). You can work-around
this bug by avoiding the -o option when sending to an old rsync.
Do you have the "ignore ownership" option turned on? What version of rsync do you have?
Also, have you tried manually creating a similar hardlink using ln at the command line?
I don't know if this is the same issue, but I know that rsync can't sync a file when the destination is a FAT32 partition and the filename has a ":" (colon) in it. [The source filesystem is ext3, and the destination is FAT32]
Try reconfiguring the date command so that it doesn't use a colon and see if that makes a difference.
e.g.
THE_TIME=`date "+%Y-%m-%dT%H_%_%S"`