Linux-Noob Forums

Full Version: how can i edit via telnet? (me real noob)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

i only have access via telnet, how could i edit a text file?

i tried the ed command but i dont know how that works, i just get a number and then question-marks, i dont even know how to exit edlin.

 

thank you.

(what i am trying to do is, to edit the php.ini)

to use your text editor telnet into the box with the file you wanna edit then type cd over to the directory the file is in and type vi filenamegoeshere . once it brings up your file type i this will allow you to edit the file then when your done editing hit esc and type :wq

ur answer sounds very confusing to me, but this is what i did:

 

i copied it to a folder which i can access with my ftp.

i edited it and uploaded it again

now back in telnet, im trying to copy it where i got it from

 

these i belive are the paths:

 

/etc/php.ini <- this is where i want to copy the edited one

/home/pblach/php.ini <- this is my edited version in my folder.

 

im using this command but for some reason it doesnt work:

(beeing in the etc directory)

 

cp /home/pblach/php.ini /

cp /home/pblach/php.ini .

 

i tried both commands and they dont work, do i have a wrong syntax?

it says:

cp: cannot create reular file '/php.ini': Permission denied

 

 

thx


these i belive are the paths:

 

/etc/php.ini <- this is where i want to copy the edited one

/home/pblach/php.ini <- this is my edited version in my folder.

 

im using this command but for some reason it doesnt work:

(beeing in the etc directory)

 

cp /home/pblach/php.ini /

cp /home/pblach/php.ini .

 

i tried both commands and they dont work, do i have a wrong syntax?

it says:

cp: cannot create reular file '/php.ini': Permission denied

------------------------------------------------------------------------------------

if you want the file /home/pblach/php.ini to overwrite /etc/php.ini type

cp /home/pblach/php.ini /etc/php.ini

i beleive by doin cp /home/pblach/php.ini / you were trying to write it straight to the root directory which is why you were getting permission errors, which would be good cuz you didnt want it there anyway.


you are getting permission denied because you are not root

 

to login as root type this

 

su -

 

note the - after su

 

also, do NOT use telnet. it is totally insecure, use ssh instead

 

cheers

 

anyweb

you shold not be using telnet. try OpenSSH.

Guest


Tek-69 is right. Your not quite telling it to do what you want. The syntax for cp goes like this:

 

cp <source> <destination>

 

so you want to type :

 

cp /home/pblach/php.ini /etc

 

And like the other guys said, you really don't want to use telnet, ssh is the way to go. If you're using windows, try using PuTTY.

 

[/url]http://www.chiark.greenend.org.uk/~sgtatham/putty/

 

Also, your original question about wasn't really answered. vi is a standard editor in linux. If you type vi <filename> it will open the file to be edited. Using vi is not extremely intuitive so you might want to check out a small tutorial on how to use it. Here is one I just googled:

 

[url=http://www.bo.infn.it/alice/alice-doc/mll-...i-ex/node2.html]http://www.bo.infn.it/alice/alice-doc/mll-...i-ex/node2.html

 

Good luck.