Sponsored Content
Top Forums Programming Trying to ssh as another user and cd to directory Post 302742009 by elixir_sinari on Monday 10th of December 2012 11:04:44 AM
Old 12-10-2012
Code:
varx=$(su nbadmin -c "ssh server1 'find /tmp/TSTCON01 -type d -name \"*[0-9][0-9]*\"'")

This User Gave Thanks to elixir_sinari For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

ssh home directory permission

Hi All, I am using sftp to transfer files between two unix machines. As per my knowledge, in order to use public key authentication, the remote user's home directory permission should be set to 750 ( basically group and others should not have write permission ). Is there any way to over ride... (1 Reply)
Discussion started by: shihabvk
1 Replies

2. UNIX for Dummies Questions & Answers

.ssh directory question (Can i move it)

Hi All, pn:/wrk/an/tran/cr>) ls -ld .ssh drwx------ 2 crcv1ftp canusr 96 May 2 2007 .ssh I had .ssh directory inside a directory . When i trying to do find and delete automatic script . The find comman is failing saying it dont have permision to read .ssh . Can i move... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

3. UNIX for Dummies Questions & Answers

.ssh directory not created

I have created a new user account on my openssh system.But the .ssh directory was not created under my home dir home/A00d56/. Could any one please suggest me whether the .ssh directory will be created automatically when we add the new user or we need to create that after? The use of this new... (3 Replies)
Discussion started by: srrao.ch
3 Replies

4. UNIX for Advanced & Expert Users

.SSH directory not created

I have created a new user account on my openssh system.But the .ssh directory was not created under my home dir home/A00d56/. Could any one please suggest me whether the .ssh directory will be created automatically when we add the new user or we need to manually create that after? The use of... (3 Replies)
Discussion started by: srrao.ch
3 Replies

5. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

6. UNIX for Dummies Questions & Answers

change user> to user@host> ssh prompt

Hi, I was wondering how to change the prompt for my ssh login. At the moment it is like user> while I'd like it to be as user@host> It is in the .bash_profile or .ssh ??? Thanks (2 Replies)
Discussion started by: pmasterkim
2 Replies

7. Red Hat

Cannot ssh for a user

This is the entry when I tail /var/log/secure when I ssh for user "nightly"... Aug 4 03:19:48 itanium2 sshd: Illegal user nightly from ::ffff:10.91.220.35 Aug 4 03:20:10 itanium2 sshd: Failed password for illegal user nightly from ::ffff:10.91.220.35 port 32862 ssh2 What could be... (3 Replies)
Discussion started by: kirtikjr
3 Replies

8. AIX

passwordless entry using ssh from one user to a different user on the same server

Hi, We have a requirement to do passwordless entry from one user to a different user on the same AIX server using ssh keys. Can some one help me with this? Thanks in advance, Panditt (3 Replies)
Discussion started by: deshaipet
3 Replies

9. Shell Programming and Scripting

[SSH] Accessing remote directory with user-passed path

Hi everybody, Currently, I have a script which access a remote computer via SSH, go to a folder already defined in the code and then executes a program in it, just like that: ssh user@host << EOI cd path ./file EOI It executes fine, but now I want to pass an argument in the command... (2 Replies)
Discussion started by: lgb3
2 Replies

10. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies
SSH-COPY-ID(1)						      General Commands Manual						    SSH-COPY-ID(1)

NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine and append the indicated identity file to that machine's ~/.ssh/autho- rized_keys file. If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file. If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin- gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary.) NOTES
This program does not modify the permissions of any pre-existing files or directories. Therefore, if the remote sshd has StrictModes set in its configuration, then the user's home, ~/.ssh folder, and ~/.ssh/authorized_keys file may need to have group writability disabled manu- ally, e.g. via chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys on the remote machine. SEE ALSO
ssh(1), ssh-agent(1), sshd(8) OpenSSH 14 November 1999 SSH-COPY-ID(1)
All times are GMT -4. The time now is 01:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy