New answers tagged

1

Copy user2's private key to user1: cp /home/user2/.ssh/id_rsa /home/user1/.ssh/id_rsa.user2 cp /home/user2/.ssh/id_rsa.pub /home/user1/.ssh/id_rsa.user2.pub chown user1:group1 /home/user1/.ssh/id_rsa.user2{,.pub} As user1, connect with this alternate identity: ssh -i /home/user1/.ssh/id_rsa.user2 Or add host entry to /home/user1/.ssh/config Host B ...


0

"Trust of relationship" is unknow in unix world. We know of sudo or ssh without password. You could not easily have a three step "trust" (user1@A -> user2@A -> remoteuser@B). either transfert script to user2 allow user1 to passwordless sudo to user2 allow user1 to passwordless log to B as remoteuser You will have to edit /etc/sudoers.conf or copy user2 ...


4

There are many possible solutions for that: You can configure sudo not to require tty: RequireTTY in /etc/sudoers You can force tty allocation on command-line in these specific cases, where you need it: ssh -tt host command You can tell scp not to allocate TTY by -T or -o RequestTTY=no command-line option: scp -T file host:path/ or scp -o RequestTTY=no ...


5

SCP protocol is binary one. With TTY enabled, the control characters have their meaning. So as soon as the TTY sees a character in the SCP protocol binary data that appears as a control character, it interprets it. Particularly as soon as there's ^C (ASCII 0x03), it aborts the SCP process. Use ssh -t to force TTY for interactive sessions, instead of ...


0

scp does overwrite files and there's no switch to stop it doing that, but you can copy things out the way, do the scp and then copy the existing files back. Examples: Copy all existing files out the way mkdir original_files ; cp -r * original_files/ Copy everything using scp scp -r user@server:dir/* ./ Copy the original files over anything scp has ...


0

What I need to disable eth0, after that, it works fine!


1

Assuming there are no spaces in the dir names: echo foo bar baz | sed "s#[^ ]*#'&'#g;s/ /,/g;s/.*/{&}/" outputs: {'foo','bar','baz'}



Top 50 recent answers are included