I am unable to add any file into my .ssh directory
the commandnd
ssh -T git#gitlab.com
returns me
"git#gitlab.com: Permission denied (publickey)."
I am unable to touch the file
Related
I am moving a file newp from Directory Lenovo to Users it says permission denied in cygwin.
Lenovo#Aditya /cygdrive/c/Users/Lenovo
$ mv newp ../
mv: cannot move 'newp' to '../newp': Permission denied
How do I change the permission?
Steps to make this work:
1.)Generate the SSH keys from ssh-keygen.
2.)Enter to the remote server and in that create a folder named .ssh/authorized_keys.
3.)Copy paste the key in the remote server's authorized_key folder.
4.)Run command rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress hello.txt ec2-user#xx.xx.xxx.xx:/home/ec2-user
Note: hello.txt is a file that is created, which is to transfer to remote server.
Follow this link here to get the more idea.
I am trying to transfer files to my Google cloud hosted Linux (Debian) instance via secure copy (scp). I did exactly what the documentation told to connect from a local machine to the instance. https://cloud.google.com/compute/docs/instances/connecting-to-instance.
Created a SSH keygen
Added the keygen to my instance
I can login successfully by:
ssh -i ~/.ssh/my-keygen [USERNAME]#[IP]
But when I want to copy files to the instance I get a message "permission denied".
scp -r -i ~/.ssh/my-keygen /path/to/directory/ [USERNAME]#[IP]:/var/www/html/
It looks like the user with which I login has no permissions to write files, so I already tried to change the file permissions of /var/www/, but this still gives the permission denied message.
I also tried to add the user to the root group, but this still gives the same problem.
usermod -G root myuser
The command line should be
scp -r -i ~/.ssh/my-keygen /path/to/directory/ [USERNAME]#[IP]:/var/www/html/
Assuming your files are in the local /path/to/directory/ and the /var/www/html/ is on the remote server.
The permissions does not allow to write in the /var/www/html/. Writing to /tmp/ should work. Then you can copy the files with sudo to the desired destination with root privileges.
If SSH isn't working, install gcloud CLI and run the following locally: gcloud compute scp --recurse /path/to/directory [IP] --tunnel-through-iap. This will dump the directory into your /home/[USERNAME]/ folder. Then log into the console and use sudo to move the directory to /var/www/html/.
For documentation, see https://cloud.google.com/sdk/gcloud/reference/compute/scp.
I gonna backup some files from a local machine to a remote server trough rsync over ssh. Here is the command I used:
rsync -avh -e "ssh -p 3286" somelocal_folder/ me#x.x.x.x:/data/bu/
The user(me) which I use to ssh to the server has rwx permissions on /data/bu directory but it does not have write permission on /data. It raises permission denied error when I enter my password. I searched a lot in the Internet,but I could not find any thing relevant. Any idea of the cause of the problem?!!
I am trying to run the following command on my Ubuntu machine
root#manav-R761-c:/# ls -la /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
ls: cannot access /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger: No such file or directory
root#manav-R761-c:/#
root#manav-R761-c:/# echo 'hash:stacktrace:bytes_req,bytes_alloc' > /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
bash: /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger: Permission denied
I am logged in as root, then why I am not able to create trigger file and write to it?
I mounted a directory using nfs. I am able to cd into the mounted directory and able to list the
one file in the directory. But when I try a ls -li on the file, it keeps failing with
ls: rst_dst/testnew1: Permission denied.
I tried to chmod the file but it keeps failing with chmod: failed to get attributes of 'rst_dst/testnew1': Permission denied. Even the stat command keeps failing with 'Unable to stat the file'.
I tried a sudo ls/chmod but it fails with the same errors.
I am able to chmod the file on the actual machine hosting the directory. But unable to read/write/modidy the permissions through the mounted directory.
Am I missing something?
On hosting machine check file /etc/exports which permissions you allow.
On guest machine check your mount command or line in /etc/fstab with which permissions you are mounting it.