Jump to content
th1alb

how can i edit via telnet? (me real noob)

Recommended Posts

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest Ben

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.

 

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:

 

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

 

Good luck.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...