![]() To check the permissions on the /. chmod u rwx,go-rwx /.ssh OR chmod 0700 /.ssh. If you ever encounter the above error, you can set correct ssh directory permissions on the. Now this rule applies to any host with "apps" in its hostname. Set Correct SSH Directory Permissions in Linux. So I added this to my ~/.ssh/config file: Host *apps* If you'd like to see this behavior all the time for specific (or any) hosts with the normal ssh command without having to use extra command line arguments, you can set the RequestTTY and RemoteCommand options in your ssh config file.įor example, I'd like to type only this command: ssh qaapps18īut want it to always behave like this command: ssh -t qaapps18 'cd $JBOSS_HOME exec $SHELL' ![]() For example, this will cd to the directory that is stored in the JBOSS_HOME variable on the remote machine: sshcd \$JBOSS_HOME If you are using a variable that exists on the remote machine for the directory, be sure to escape it or put it in single quotes. ![]() You can make this work by adding this to your ~/.bashrc: sshcd () ssh/idrsa.pub file from the client into the authorizedkeys file that you just created. imac: jim ls -l /.ssh/ -rw- 1 jim staff 0 Jun 29 11:43 authorizedkeys -rw- 1 jim staff 0 Jun 29 11:43 idrsa.pub -rw-r-r- 1 jim staff 0 Jun 29 11:42 idrsa If they don’t have the correct permission, use the following. ssh directory and should confirm they have the following permissions. ssh directory with an authorizedkeys file in the users /home/directory. You can check the file permission in the. Let's say you just want to type this: sshcd /foo/bar Configure the correct permissions and ownership for the chroot directory. You can simplify the command by wrapping it in a bash function. Alternatively, you can use single quotes, and all of the variables you use will be the ones from the target machine: ssh -t 'cd /foo/bar exec $SHELL -l' Using double quotes will allow you to use variables from your local machine, unless they are escaped (as $SHELL is here). I think the best answer for this approach is christianbundy's reply to the accepted answer: ssh -t "cd /foo/bar exec \$SHELL -l" My preferred approach is using the SSH config file (described below), but there are a few possible solutions depending on your usages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |