Sponsored Content
Full Discussion: Vi editing with a command
Top Forums Shell Programming and Scripting Vi editing with a command Post 302902566 by rbatte1 on Wednesday 21st of May 2014 06:57:25 AM
Old 05-21-2014
Can you remote shell or SSH connect without a password with sufficient privileges?

If so, then you can set up a loop to execute the same to each server submitting a chuser command rather than editing the file.


What have you got so far?


Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

editing bash command line with vi

Is there a way using bash that I can edit a command line using vi. I.e. if I have a long command line and I want to edit it.....by typing vi and then having the command open in an editing window.... I beleive this can be done in k shell by pressing v....however can find out how this can be... (3 Replies)
Discussion started by: peter.herlihy
3 Replies

2. Shell Programming and Scripting

Single line file editing command?

Hello everyone. I have been reading a lot about the various different text editors at my disposal through Unix, but I just can't seem to close the deal for what I am trying to do. Is there a way to issue a single line command to edit a file where pattern=x, and do it non-destructively AND in-place?... (1 Reply)
Discussion started by: gator76
1 Replies

3. Shell Programming and Scripting

file editing

hi experts, please help me in writting the script.. i have two files file1 and file 2 i have to write a script which will take input parameters as file1 and file2 file1: ...... 1 2 3 4 file2: ..... 1 2 output (6 Replies)
Discussion started by: subhendu81
6 Replies

4. UNIX for Dummies Questions & Answers

Shutcut for editing a command.

Hi, I need a help on editing a long command. For comming to end of the command I am using ctrl+E and for start of the command I am using Ctrl+A. But don't how to iterate word by word. For this purpose I am using aerrow keys character by character. Do we have any shut cut for moving word by word? (3 Replies)
Discussion started by: siba.s.nayak
3 Replies

5. Shell Programming and Scripting

editing a file

Hi i have a file name as file1 which has Following content: ROLLOVER_INTERVAL=0 OUTPUT_DIR_COUNT=MULTIPLE FILETYPE=XmlExporter i want to change the FILETYPE=recordexport can any one pls help me on this 2nd query: i want to change OUTPUT_DIR_COUNT=MULTIPLE as ... (2 Replies)
Discussion started by: Aditya.Gurgaon
2 Replies

6. UNIX for Dummies Questions & Answers

ksh command line editing text being overwritten

hi. i'm using ksh with set -o vi. if i am far down in a directory and try to edit the command line (esc-k to retrieve previous command) the cursor is being positioned over to the left on top of the directory text making the text very difficult to read or work with. seems to be problem with long... (2 Replies)
Discussion started by: jeffa123
2 Replies

7. Shell Programming and Scripting

problem in using sed command in editing a file

Hi all, I have a conf file, i want to update some entries in that conf file. Below is the code for that using a temporary file. sed '/workgroup=/ c\workgroup=Workgroup' /usr/local/netx.conf > /usr/local/netx.conf.tmp mv -f /usr/local/netx.conf.tmp /usr/local/netx.conf Sample contents of... (9 Replies)
Discussion started by: ranj14r
9 Replies

8. UNIX for Dummies Questions & Answers

stuck in editing file with cat command

Hi, While editing a small text file with cat command i pressed ctrl-d to send eof, instead of coming out of cat command it echoed ^D to the screen. Same thing is happening to ctrl-c. After googling i found this is because of trap. The problem is i m stuck in editing mode and cannot get the... (3 Replies)
Discussion started by: TITANIUM
3 Replies

9. Shell Programming and Scripting

Editing the timestamp

i have data in 3 columns in the format below 2011-11-01-0936,2115,978 2011-11-01-0937,2242,1046 2011-11-01-0938,2538,1186 2011-11-01-0939,2295,1074 2011-11-01-0940,2454,1142 2011-11-01-0941,2545,1184 2011-11-01-0942,2491,1153 I however want to either remove the date on the timestamp and... (2 Replies)
Discussion started by: thinktank
2 Replies

10. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
ssh(3erl)						     Erlang Module Definition							 ssh(3erl)

NAME
ssh - Main API of the SSH application DESCRIPTION
Interface module for the SSH application COMMON DATA TYPES
Type definitions that are used more than once in this module: boolean() = true | false string() = list of ASCII characters ssh_daemon_ref() - opaque to the user returned by ssh:daemon/[1,2,3] ssh_connection_ref() - opaque to the user returned by ssh:connect/3 ip_address() - {N1,N2,N3,N4} % IPv4 | {K1,K2,K3,K4,K5,K6,K7,K8} % IPv6 subsystem_spec() = {subsystem_name(), {channel_callback(), channel_init_args()}} subsystem_name() = string() channel_callback() = atom() - Name of the erlang module implementing the subsystem using the ssh_channel behavior see ssh_channel(3erl) channel_init_args() = list() EXPORTS
close(ConnectionRef) -> ok Types ConnectionRef = ssh_connection_ref() Closes a ssh connection. connect(Host, Port, Options) -> connect(Host, Port, Options, Timeout) -> {ok, ssh_connection_ref()} | {error, Reason} Types Host = string() Port = integer() The default is 22 , the registered port for SSH. Options = [{Option, Value}] Timeout = infinity | integer(milliseconds) Connects to an SSH server. No channel is started this is done by calling ssh_connect:session_channel/2. Options are: {user_dir, String} : Sets the user directory e.i. the directory containing ssh configuration files for the user such as known_hosts , id_rsa, id_dsa and authorized_key . Defaults to the directory normally referred to as ~/.ssh {silently_accept_hosts, boolean()} : When true hosts are added to the file known_hosts without asking the user. Defaults to false. {user_interaction, boolean()} : If false disables the client to connect to the server if any user interaction is needed such as accepting that the server will be added to the known_hosts file or supplying a password. Defaults to true. Even if user interaction is allowed it can be sup- pressed by other options such as silently_accept_hosts and password. Do note that it may not always be desirable to use those options from a security point of view. {public_key_alg, ssh_rsa | ssh_dsa} : Sets the preferred public key algorithm to use for user authentication. If the the preferred algorithm fails of some reason, the other algorithm is tried. The default is to try ssh_rsa first. {connect_timeout, timeout()} : Sets a timeout on the transport layer connection. Defaults to infinity. {user, String} : Provide a user name. If this option is not given, ssh reads from the environment ( LOGNAME or USER on unix, USERNAME on Win- dows). {password, string()} : Provide a password for password authentication. If this option is not given, the user will be asked for a password if the pass- word authentication method is attempted. {user_auth, Fun/3} : Provide a fun for password authentication. The fun will be called as fun(User, Password, Opts) and should return true or false . {key_cb, atom() = KeyCallbackModule} : Provide a special call-back module for key handling. The call-back module should be modeled after the ssh_file module. The func- tions that must be exported are: private_host_rsa_key/2 , private_host_dsa_key/2 , lookup_host_key/3 and add_host_key/3 . This is considered somewhat experimental and will be better documented later on. {fd, file_descriptor()} : Allow an existing file-descriptor to be used (simply passed on to the transport protocol). {ip_v6_disabled, boolean()} : Determines if SSH shall use IPv6 or not. connection_info(ConnectionRef, [Option]) ->[{Option, Value}] Types Option = client_version | server_version | peer Value = term() Retrieves information about a connection. daemon(Port) -> daemon(Port, Options) -> daemon(HostAddress, Port, Options) -> ssh_daemon_ref() Types Port = integer() HostAddress = ip_address() | any Options = [{Option, Value}] Option = atom() Value = term() Starts a server listening for SSH connections on the given port. Options are: {subsystems, [subsystem_spec()] : Provides specifications for handling of subsystems. The "sftp" subsystem-spec can be retrieved by calling ssh_sftpd:subsys- tem_spec/1. If the subsystems option in not present the value of [ssh_sftpd:subsystem_spec([])] will be used. It is of course possible to set the option to the empty list if you do not want the daemon to run any subsystems at all. {shell, {Module, Function, Args} | fun(string() = User) - > pid() | fun(string() = User, ip_address() = PeerAddr) -> pid()} : Defines the read-eval-print loop used when a shell is requested by the client. Example use the erlang shell: {shell, start, []} which is the default behavior. {ssh_cli,{channel_callback(), channel_init_args()}} : Provide your own cli implementation, e.i. a channel callback module that implements a shell and command execution. Note that you may customize the shell read-eval-print loop using the option shell which is much less work than implementing your own cli chan- nel. {system_dir, string()} : Sets the system directory, containing the host files that identifies the host for ssh. The default is /etc/ssh , note that SSH normally requires the host files there to be readable only by root. {user_passwords, [{string() = User, string() = Password}]} : Provide passwords for password authentication.They will be used when someone tries to connect to the server and public key user authentication fails. The option provides a list of valid user names and the corresponding password. {password, string()} : Provide a global password that will authenticate any user. From a security perspective this option makes the server very vulner- able. {pwdfun, fun/2} : Provide a function for password validation. This is called with user and password as strings, and should return true if the password is valid and false otherwise. {fd, file_descriptor()} : Allow an existing file-descriptor to be used (simply passed on to the transport protocol). {ip_v6_disabled, boolean()} : Determines if SSH shall use IPv6 or not (only used when HostAddress is set to any). shell(Host) -> shell(Host, Option) -> shell(Host, Port, Option) -> _ Types Host = string() Port = integer() Options - see ssh:connect/3 Starts an interactive shell to an SSH server on the given Host . The function waits for user input, and will not return until the remote shell is ended (e.g. on exit from the shell). sign_data(Data, Algorithm) -> Signature | {error, Reason} Types Data = binary() Algorithm = "ssh-rsa" Signature = binary() Reason = term() Signs the supplied binary using the SSH key. start() -> start(Type) -> ok | {error, Reason} Types Type = permanent | transient | temporary Reason = term() Starts the Ssh application. Default type is temporary. See also application(3erl) Requires that the crypto application has been started. stop() -> ok Stops the Ssh application. See also application(3erl) stop_daemon(DaemonRef) -> stop_daemon(Address, Port) -> ok Types DaemonRef = ssh_daemon_ref() Address = ip_address() Port = integer() Stops the listener and all connections started by the listener. stop_listener(DaemonRef) -> stop_listener(Address, Port) -> ok Types DaemonRef = ssh_daemon_ref() Address = ip_address() Port = integer() Stops the listener, but leaves existing connections started by the listener up and running. verify_data(Data, Signature, Algorithm) -> ok | {error, Reason} Types Data = binary() Algorithm = "ssh-rsa" Signature = binary() Reason = term() Verifies the supplied binary against the binary signature. Ericsson AB ssh 2.0.4 ssh(3erl)
All times are GMT -4. The time now is 12:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy