this is what i get when i try to rm file on sftp server:
(when i run rename it's the same)
sftp> rm file
debug3: Sent message fd 3 T:7 I:34854
debug3: Received stat reply T:105 I:34854
Removing file
debug2: Sending SSH2_FXP_REMOVE "file"
debug3: Sent message fd 3 T:13 I:34855
debug3: SSH2_FXP_STATUS 4
Couldn't delete file: Failure
and file perms is:
-rw-rw-rw- 0 --NA-- --NA-- 6862 Sep 9 17:05 file
am i missing something?
somebody can help?
thanks in advance
For certain networked file systems, like Hetzner backup space, files cannot be no longer deleted over SFTP if the disk space is 100% full. Trying to delete file using SFTP leads to this exact error message.
As a workaround one can extend the allocated backup space by ordering larger backup space plan.
Related
im trying uwsgi+nginx+django tutorial, and got stuck there (link links directly to section where i got stuck)
https://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#if-that-doesn-t-work
nginx error.log says:
2015/03/09 13:44:51 [crit] 11642#0: *16 connect() to unix:///home/gaucan/temp/my_app/mysite.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///home/gaucan/temp/my_app/mysite.sock:", host: "localhost:8000"
and tutorial says to fix it, do the following:
You may also have to add your user to nginx’s group (which is probably www-data), or vice-versa, so that nginx can read and write to your socket properly.
But im linux noob and i don't know how to this, or how to find out if that group is www-data or not... already did some mess before with changing owner to some folders to user:"gaucan"
also i did skip in tutorial this step:
You will need the uwsgi_params file, which is available in the nginx directory of the uWSGI distribution, or from https://github.com/nginx/nginx/blob/master/conf/uwsgi_params
since i don't know which directory is nginx directory of the uWSGI distribution...
btw i use FEDORA if thats any help...
To find the permissions of a file:
ls -al unix:///home/gaucan/temp/my_app/mysite.sock
That will print some columns of information, the first of which will be the unix permissions:
-rw-rw-r-- 1 user group 1234 Mar 9 2015 name of file
The first dash is special, just ignore it. The next three characters represent the read, write, and exeute permissions of the User who owns the file. Next 3 represent the group who owns the file. The last 3 represent everyone else.
The nginx process needs to be able to write to that socket file.
You don't have to add your user to the same group as nginx, but you do need to allow proper permissions on the socket. Those instructions as written don't make 100% sense to me.
-- instructions to add your user to a group anyway --
To find the user of a process:
ps aux | grep nginx
One of the output columns will be the user of the nginx process
To find out what groups you belong to:
groups
That will print a space separated list of unix groups that you belong to.
To set a brand new list of groups that you belong to
sudo usermod -G group1,group2 username
Note that the groups are comma separated and they will wipe out any existing groups, so you need to re-type all the existing groups into that command with commas.
Alternatively, use the --append flag of usermod:
sudo usermod --append -G www-data username
You must completely logout and login again to gain the effect of the new groups. (There may exist a shortcut to reload your groups, but I'm not aware of one)
not sure what everything wrong i did, but simply after spending whole day on it, i retried the tutorial, but i tried to write directly all config into /etc/nginx/nginx.conf and it did work then... so that was the bad steps at the tutorial (creating own mysite_nginx.conf and then symlinking with some sites-enabled which didnt even exist in this new version of nginx... )
also did placed socket in /tmp/sock.sock mb that helped too..
I solved the "Permission denied" problem by changing the socket location to "/tmp/sock.sock". My socket was previously somewhere under /root and I kept getting "Permission denied" even after I did "chmod 777".
I'm using rsync in solaris and couldn't find an exit code if there is no file or folder modification/addition or deletion done on the destination folder. How can I get the status if rsync doesn't have one ?
0 Success
1 Syntax or usage error
2 Protocol incompatibility
3 Errors selecting input/output files, dirs
4 Requested action not supported: an attempt was made to manipulate 64-bit
files on a platform that cannot support them; or an option was specified
that is supported by the client and not by the server.
5 Error starting client-server protocol
6 Daemon unable to append to log-file
10 Error in socket I/O
11 Error in file I/O
12 Error in rsync protocol data stream
13 Errors with program diagnostics
14 Error in IPC code
20 Received SIGUSR1 or SIGINT
21 Some error returned by waitpid()
22 Error allocating core memory buffers
23 Partial transfer due to error
24 Partial transfer due to vanished source files
25 The --max-delete limit stopped deletions
30 Timeout in data send/receive
35 Timeout waiting for daemon connection
Thank you
There is a work around
rsync --log-format=%f ...
Note that rsync outputs files anytime any attribute changes, not only if the content of the file is updated.
There is also a -i option (or --log-format=%i) that itemizes all of the changes. See the rsync man page for details of the output format.
Am trying to mount a NFS device in my linux machine.
My /etc/fstab is like this,
192.168.0.5:/volume2/Asterisk_Recordings /var/spool/newnfs nfs rsize=32768,wsize=32768,intr,noatime 1 0
My /etc/mtab is like this,
192.168.0.5:/volume2/Asterisk_Recordings /var/spool/newnfs nfs rw,addr=192.168.0.5 0 0
I have enabled NFS in my NAS device.
When i type mount " mount -t nfs -v 192.168.0.5:/volume2/Asterisk_Recordings /var/spool/newnfs/" I get like this,
mount.nfs: timeout set for Thu Aug 1 07:01:04 2013
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.5,clientaddr=192.168.1.1'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.0.5:/volume2/Asterisk_Recordings
Any possible reasons?
Thanks in advance.
This error can also occur if the /etc/hosts file on the nfs server maps the hostname of the client to an incorrect IP address, or the IP address of the client to an incorrect hostname. It is quick and easy to check, so worth doing before looking for other problems. Note that, if you do have to change any entries then the nfs-server has to be stopped and re-started, as it reads the hosts file only when it is started.
Is there a config file on the NAS where to put allowances for clients? E.g. in debian based OS the config file is "/etc/exports" and you would put there "/volume2/Asterisk_Recordings 192.168.1.1(rw,sync)" and activate this with "exportfs -a" (your NAS may do this automatically if you update the config via a web interface, I guess.) Check also https://stackoverflow.com/questions/22246477/mounting-nfs-results-in-access-denied-by-server.
Remember to add IP addresses/hostnames of your NFS' clients to /etc/hosts.allow of NFS' server
nfs: clienthost2, clienthost2, clienthost3
You might restart nfs config and nfs service on the NFS server as well as run export again.
systemctl restart nfs-config.service
systemctl status nfs.service
exportfs -arv
I have a Debian 10 system with a Debian 10 VM running inside it. I wanted to access a physical partition from the hard drive on the VM. I mounted the physical drive on the host and exported it. I was not able to mount it on the guest continually getting a access denied error
The solution after many hours was to add the no_all_squash option in the exports file. This is supposed to be the default but I needed to add it explicitly. As soon as I did that the problem went away and I could mount the file system. Unfortunately I could not see the files on the fs.
/media/dev 192.168.100.0/24(rw,sync,no_subtree_check,no_root_squash,no_all_squash)
On the server I could see the files and on the host I could not.
I had to change the line to
/media/dev 192.168.100.0/255.255.255.0(rw,sync,no_subtree_check,no_root_squash,no_all_squash)
to see the actual files that were on the file sets
I saw this error presumably due to an older NFS client and adding -o nfsvers=3 fixed the issue for me e.g. mount -t nfs -o nfsvers=3 x.x.x.x:/nfs_mount /mnt/nfs_mount
Or in /etc/fstab
x.x.x.x://nfs_mount /mnt/nfs_mount nfs proto=tcp,port=2049,nfsvers=3 0 0
Ref: https://www.thegeekdiary.com/mount-nfs-access-denied-by-server-while-mounting-how-to-resolve/
So I run the command:
edmund#cat:/images/edmund/gallery$ rsync -rzvO --exclude='.svn' ./ edmund#dog.com:/images/edmund/gallery/
My local directory is empty, while the directory on the remote server is full of pics. This is the result of running the command:
sending incremental file list
sent 24 bytes received 12 bytes 5.54 bytes/sec
total size is 0 speedup is 0.00
However, nothing is in my folder. Does anyone know what I'm doing wrong? Could it be an SSH issue?
If you are on the local server which has no pictures you need to connect to the remote server. You need to reverse your syntax:
edmund#cat:/images/edmund/gallery$ rsync -rzvO --exclude='.svn' edmund#dog.com:/images/edmund/gallery/ ./
Syntax is rsync [Source] [Destination]. See man page for rsync.
I have a server where I store data from Mac A and Mac B.
I use rsync to keep the files updated between my Macs.
I run the following code unsuccessfully
#!/bin/zsh
# to copy files from my server to my folder
rsync -Pav $Masi:~/private/ ~/Dropbox/Courses/math/
# to copy files from my folder to my server
rsync -Pav ~/Dropbox/Courses/math $Masi:~/private/
I get the following error message
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.5]
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.5]
I have ssh keys in place so the connection should work, since I can use scp without problems.
How can you use rsync between my server and one of my Macs?
I used to do a lot of this. Just ran a test, a few suggestions.
Spell out your entire user#host pattern
Run the ssh connection sans the rsync first, you may need to first approve your fingerprint
You do not seem to pass a flag to protect extended attributes, this can yield broken files on OS X. If you do not need resource forks, you are OK, but most of the time you do need them.
My test case:
$ rsync -Pav ~/Desktop/ me#remote.example.com:~/rsyc-test
In that case, all the files within ~/Desktop were copied to the remote host, in my home dir. Since the directory 'rsyc-test' did not exist, it was made for me. I had a .app on my Desktop, it made it over, surprisingly, it works. Even some .webloc files made it and appear to work, though I do not trust it.
I would strongly suggest adding in the -E flag
-E, --extended-attributes
Apple specific option to copy extended attributes, resource
forks, and ACLs. Requires at least Mac OS X 10.4 or suitably
patched rsync.
I ran a new test, moved a Interarchy bookmark to my desktop, I know for a fact these break if they are copied sans resource forks. Running without the -E versus with the -E, there is a difference of 152 bytes in xfered data. The first file on the remote machine did not work, the second transfered file did work.
I can not help but notice in your example one of your paths is ~/Dropbox so this may all not matter, since DropBox, the app, does not at all support resource forks currently, though I hear there are plans to in the future.
You also are not sending in the --delete flag, if your end goal is a mirror of your data, you are not getting that, if your end goal is backups that continually grows, keeping everything that was ever on the source, the lack of --delete is good.
Other notes:
You can exclude those silly .DS_Store files
--exclude '.DS_Store'
You can also set rsync up in a way to be a true mirror, so you would not need to run your other command, see the man page for details.
My final working command to shove the Desktop of my laptop to a remote machine:
$ rsync -PEav --delete --exclude '.DS_Store' ~/Desktop/ me#remote.example.com:~/rsycn-test
Check "$Masi". Is that the hostname you are trying to reach?
Try the following command to debug it:
rsync -e 'ssh -v' -Pav $Masi:~/private/ ~/Dropbox/Courses/math/
The Connection refused usually happens when there is a connection issue to the remote (e.g. firewall).
In your case the problem is that $Masi variable is empty. If it's not variable, use Masi.
As per this error:
ssh: connect to host port 22: Connection refused
Notice the double space above after the host word.
the connect to host message doesn't say to which host, so you're trying to connect to empty host. So it sound like a typo in the host name.