proper way to sudo over ssh
Another way is to use the -t
switch to ssh
:
ssh -t user@server "sudo script"
See man ssh
:
-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g., when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.
How do I pull from a git repo on a remote machine through ssh?
From what I understood with your issue, here is my suggestion :
[ Information is somewhat incomplete though ]
GIT reads your id_rsa.pub in root user directory : /home/root/.ssh/id_rsa.pub
That's why your key in /home/your_username/.ssh/id_rsa.pub might not be read by git.
Hence, please check and create the key in /home/root/.ssh/
$ sudo su
$ ssh-keygen
$ cd ~/.ssh
$ cat id_rsa.pub
Hope it helps.
Can I Add Local Users to Manage a Gitolite Repository with SSH?
The gitolite@ on the front of the URL is not actually the user as you use with SSH. It is the service (I assume) on the server so gitolite@localhost:my-repo is completely valid.
You will see a reference to git@ all the time when working with GIT. Your service is gitolite so gitolite@ will always be used.
Git servers authenticate using SSH public keys so the key you created is what allows the user to connect to the server. That key is also related to that user so when that key is used it is assumed that is the user issuing git commands such as a commit.
On a side note a colleague recommend http://documentup.com/skwp/git-workflows-book when I first started using our GIT system and it was a great help in understanding this truly wonderful version control system.
Related Topics
Graphing The Dag Generated by Make
How to Accept Multiple Tcp Connections in Perl
How to Generate a Static HTML File from a Swagger Documentation
Set Environment Variables in an Aws Instance
Any Good Guides on Using Ptrace_Sysemu
Fork() and Stdout/Stderr to The Console from Child Processes
Transpose Rows into Column in Unix
Test If String Has Non Whitespace Characters in Bash
Rpm Installation Fails Due to Depencency /Bin/Sh Not Found
"Must Be Connected to a Terminal Error" with Screen -X Command on a Linux Container
Debian Start Qt Gui Application with No Desktop
How to Search for a Particular String from a .Gz File
Surprise! The Shell Suggests Command Line Switches
Application Counters in Linux? (And Osx)
How to Convert Dynamically Linked Application to Statically One